//************form validation function formValidation1() { if (document.getElementById('name').value == "") { //alert("Please enter a value for the name field.") alert('Please enter a value for the name field.'); document.getElementById('name').focus(); return (false); } if (document.getElementById('day').value == "") { alert('Please enter a value for the day field. '); document.getElementById('day').focus(); return (false); } else { if (isNaN(document.getElementById('day').value)) { alert('Please enter only digit characters in the day field.'); document.getElementById('day').focus(); return (false); } else { if (document.getElementById('day').value < 1 || document.getElementById('day').value > 31) { alert('The value for day should be between 1 and 31.'); document.getElementById('day').focus(); return (false); } } } if (document.getElementById('month').value == "") { alert('Please enter a value for the month field.'); document.getElementById('month').focus(); return (false); } else { if (isNaN(document.getElementById('month').value)) { alert('Please enter only digit characters in the month field.'); document.getElementById('month').focus(); return (false); } else { if (document.getElementById('month').value < 1 || document.getElementById('month').value > 12) { alert('The value for month should be between 1 and 12.'); document.getElementById('month').focus(); return (false); } } } if (document.getElementById('year').value == "") { alert('Please enter a value for the year field.'); document.getElementById('year').focus(); return (false); } else { if (isNaN(document.getElementById('year').value)) { alert('Please enter only digit characters in the year field.'); document.getElementById('year').focus(); return (false); } else { if (document.getElementById('year').value < 1 || document.getElementById('year').value > 9999) { alert('The value for year should be between 1 and 9999.'); document.getElementById('year').focus(); return (false); } } } if (document.getElementById('hrs').value == "") { alert('Please enter a value for the hour field.'); document.getElementById('hrs').focus(); return (false); } else { if (isNaN(document.getElementById('hrs').value)) { alert('Please enter only digit characters in the hour field.'); document.getElementById('hrs').focus(); return (false); } else { if (document.getElementById('hrs').value < 0 || document.getElementById('hrs').value > 23) { alert('The value for hour should be between 0 and 23.'); document.getElementById('hrs').focus(); return (false); } } } if (document.getElementById('min').value == "") { alert('Please enter a value for the minute field.'); document.getElementById('min').focus(); return (false); } else { if (isNaN(document.getElementById('min').value)) { alert('Please enter only digit characters in the minute field.'); document.getElementById('min').focus(); return (false); } else { if (document.getElementById('min').value < 0 || document.getElementById('min').value > 59) { alert('The value for minute should be between 0 and 59. '); document.getElementById('min').focus(); return (false); } } } if (document.getElementById('sec').value == "") { alert('Please enter a value for the second field.'); document.getElementById('sec').focus(); return (false); } else { if (isNaN(document.getElementById('sec').value)) { alert('Please enter only digit characters in the second field.'); document.getElementById('sec').focus(); return (false); } else { if (document.getElementById('sec').value < 0 || document.getElementById('sec').value > 59) { alert('The value for second should be between 0 and 59.'); document.getElementById('sec').focus(); return (false); } } } if (document.getElementById('place').value == "") { alert('Please enter place.'); return (false); } if (document.getElementById('place1').value.length < 3) { alert('Please enter at least 3 starting characters of place.'); //document.getElementById('place').focus(); return (false); } if (document.getElementById('LongDeg').value == "" || document.getElementById('LongDeg').value == "LongDegree") { alert('Please enter longitude degree value.'); //validationalertalert('alertspan','alertmsgdiv', "Please enter longitude degree value."); document.getElementById('LongDeg').focus(); return (false); } if (isNaN(document.getElementById('LongDeg').value)) { alert('The value for longitude degree should be between 0 and 179.'); document.getElementById('LongDeg').focus(); return (false); } if (document.getElementById('LongDeg').value < 0 || document.getElementById('LongDeg').value >= 180) { alert('The value for longitude degree should be between 0 and 179.'); document.getElementById('LongDeg').focus(); return (false); } if (document.getElementById('LongMin').value == "" || document.getElementById('LongMin').value == "LongMinute") { alert('Please enter longitude minute value.'); document.getElementById('LongMin').focus(); return (false); } if (isNaN(document.getElementById('LongMin').value)) { alert('The value for longitude minute should be between 0 and 59.'); document.getElementById('LongMin').focus(); return (false); } if (document.getElementById('LongMin').value < 0 || document.getElementById('LongMin').value >= 60) { alert('The value for longitude minute should be between 0 and 59.'); document.getElementById('LongMin').focus(); return (false); } if (document.getElementById('LongEW').value == "" || document.getElementById('LongEW').value == "LongEW") { alert('Please enter longitude direction.'); document.getElementById('LongEW').focus(); return (false); } if (document.getElementById('LatDeg').value == "" || document.getElementById('LatDeg').value == "LatDegree") { alert('Please enter latitude degree value.'); document.getElementById('LatDeg').focus(); return (false); } if (isNaN(document.getElementById('LatDeg').value)) { alert('The value for latitude degree should be between 0 and 89.'); document.getElementById('LatDeg').focus(); return (false); } if (document.getElementById('LatDeg').value < 0 || document.getElementById('LatDeg').value >= 90) { alert('The value for latitude degree should be between 0 and 89.'); document.getElementById('LatDeg').focus(); return (false); } if (document.getElementById('LatMin').value == "" || document.getElementById('LatMin').value == "LatMinute") { alert('Please enter latitude minute value. '); document.getElementById('LatMin').focus(); return (false); } if (isNaN(document.getElementById('LatMin').value)) { alert('The value for latitude minute should be between 0 and 59.'); document.getElementById('LatMin').focus(); return (false); } if (document.getElementById('LatMin').value < 0 || document.getElementById('LatMin').value >= 60) { alert('The value for latitude minute should be between 0 and 59.'); document.getElementById('LatMin').focus(); return (false); } if (document.getElementById('LatNS').value == "" || document.getElementById('LatNS').value == "LatNS") { alert('Please enter latitude direction.'); document.getElementById('LatNS').focus(); return (false); } if (document.getElementById('TimeZone').value == "" || document.getElementById('TimeZone').value == "TimeZone") { alert('Please enter Time Zone value.'); document.getElementById('TimeZone').focus(); return (false); } if (isNaN(document.getElementById('TimeZone').value) || document.getElementById('TimeZone').value < -12.0 || document.getElementById('TimeZone').value > 14.0) { alert('The value for time zone should be between -12 hrs and 14 hrs.'); document.getElementById('TimeZone').focus(); return (false); } if (document.getElementById('ayanamsa').value == "" || document.getElementById('ayanamsa').value == "ayanamsa") { alert('Please enter Ayanamsa Value. '); document.getElementById('ayanamsa').focus(); return (false); } if (document.getElementById('charting').value == "" || document.getElementById('charting').value == "charting") { alert('Please enter Chart Type. '); document.getElementById('charting').focus(); return (false); } if (document.getElementById('kphn').value == "" || document.getElementById('kphn').value == "kphn") { alert('Please enter k.p.h.n value'); document.getElementById('kphn').focus(); return (false); } if (isNaN(document.getElementById('kphn').value) || document.getElementById('kphn').value < 0 || document.getElementById('kphn').value > 249) { alert('KP Horary Number must be between 0 and 249. '); document.getElementById('kphn').focus(); return (false); } return (true); } //******************save chart method function getSaveChartMethod(LoggedInUserId) { if (formValidation1()) { if (LoggedInUserId != "" || '' != "") { var getReturnObj = $.get('/json/ajax-save-chart.asp', $("#frm").serialize(), function(data) { var mydata = eval('(' + data + ')'); $('#currentchartid').val(mydata[0].ChartId); if (mydata[0].IsChartSave == "-2") { alert('Sorry, You can not save more charts.Please contact on mob no. +919911840126 and upgrade your plan.'); } else if (mydata[0].IsChartSave == "1" || mydata[0].IsChartSave == "-3") { alert('Your Chart has been save successfully. '); document.forms["birthfrm"].submit(); } else { alert('Sorry, Chart not saved. '); } }); } } } //************delete chart method function deleteUserSpecificChart(LoggedInUserId) { if (LoggedInUserId != "") { var valuechk = ""; valuechk = (function() { var val = null; value = LoggedInUserId; if (value != "") { var result = confirm('Are you want to delete this chart'); if (result == true) { $.ajax( { 'type': 'POST', 'async': false, 'global': false, 'url': '/control/ajax_del_userchart.asp?value=' + value, 'data': value, 'success': function(data) { val = data; } }); return val; } else { return false; } } })(); } if (valuechk == "1") { alert('Chart has been deleted successfully.'); } if (valuechk == "0") { alert('Chart can not be delete.'); } }