function subFirstForm() { if (document.getElementById("name").value == "") { alert('Please enter a value for the "Name" field.'); document.getElementById("name").focus(); return (false) } if (document.getElementById("name").value.indexOf("'") != -1 || document.getElementById("name").value.indexOf("?") != -1 || document.getElementById("name").value.indexOf("&") != -1) { alert('Please do not enter \' (single quote), ? (question mark), & (ampersand) sign in the "Name" field.'); document.getElementById("name").focus(); return (false) } if (document.getElementById("sex").value == "Gender") { alert("Please select the gender"); document.getElementById("sex").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 "Hours" field.'); document.getElementById("hrs").focus(); return (false) } else { if (isNaN(document.getElementById("hrs").value)) { alert("Please enter only digit characters in the hours field"); document.getElementById("hrs").focus(); return (false) } else { if (document.getElementById("hrs").value < 0 || document.getElementById("hrs").value > 23) { alert('The value for "Hours" should be between 1 and 23'); document.getElementById("hrs").focus(); return (false) } } } if (document.getElementById("min").value == "") { alert('Please enter a value for the "Min" field.'); document.getElementById("min").focus(); return (false) } else { if (isNaN(document.getElementById("min").value)) { alert("Please enter only digit characters in the min field"); document.getElementById("min").focus(); return (false) } else { if (document.getElementById("min").value < 0 || document.getElementById("min").value > 59) { alert('The value for "Min" should be between 1 and 59'); document.getElementById("min").focus(); return (false) } } } if (document.getElementById("sec").value == "") { alert('Please enter a value for the "Sec" field.'); document.getElementById("sec").focus(); return (false) } else { if (isNaN(document.getElementById("sec").value)) { alert("Please enter only digit characters in the sec field"); document.getElementById("sec").focus(); return (false) } else { if (document.getElementById("sec").value < 0 || document.getElementById("sec").value > 59) { alert('The value for "Sec" should be between 1 and 59'); document.getElementById("sec").focus(); return (false) } } } if (document.getElementById("place").value == "") { alert('Please enter a value for the "Place" field.'); document.getElementById("place").focus(); return (false) } if (document.getElementById("place").value.length < 3) { alert("Enter at least three first characters of city name."); document.getElementById("place").focus(); return (false) } var place1 = document.getElementById("place").value.length; if (place1 > 50) { var place = document.getElementById("place").value; place = place.substr(0, 50); document.getElementById("place").value = place; } if (document.getElementById("place").value.indexOf("'") != -1 || document.getElementById("place").value.indexOf("?") != -1 || document.getElementById("place").value.indexOf("&") != -1) { alert('Please do not enter \' (single quote), ? (question mark), & (ampersand) sign in the "Place" field.'); document.getElementById("place").focus(); return (false) } if (document.getElementById("LongDeg").value == "" || document.getElementById("LongDeg").value == "LongDegree") { alert("Please enter Longitude Degree value."); document.getElementById("LongDeg").focus(); return (false) } if (isNaN(document.getElementById("LongDeg").value)) { alert('Please enter only digit characters in the "Longitude Degree" field.'); 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 value."); 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 value."); document.getElementById("LatNS").focus(); return (false) } if (document.getElementById("timeZone").value == "") { alert("Please enter Time Zone."); document.getElementById("timeZone").focus(); return (false) } if (isNaN(document.getElementById("timeZone").value) || document.getElementById("timeZone").value < -12 || document.getElementById("timeZone").value > 13) { alert('The value for "Time Zone" should be between -12.00 and 13.00.'); document.getElementById("timeZone").focus(); return (false) } if (isNaN(document.getElementById("dst").value) || document.getElementById("dst").value < 0 || document.getElementById("dst").value > 2) { alert("DST must be between 0 and 2."); document.getElementById("dst").focus(); return (false) } document.forms.firstform.submit(); } $(document).ready(function () { $("#place").autocomplete({ search: function (event, ui) { $(this).addClass("wait"); }, open: function (event, ui) { $(this).removeClass("wait"); }, response: function (event, ui) { $(this).removeClass("wait"); }, select: function (a, b) { $('#LatDeg').val(b.item.placeObject.latDeg); $('#LatMin').val(b.item.placeObject.latMin); $('#LatNS').val(b.item.placeObject.latNS); $('#LongDeg').val(b.item.placeObject.longDeg); $('#LongMin').val(b.item.placeObject.longMin); $('#LongEW').val(b.item.placeObject.longEW); $('#timeZone').val(b.item.placeObject.timezone); }, minLength: 3, source: function (request, response) { $.ajax({ url: "https://asapi.astrosage.com/api/findplaces"/* + searchString */, type: "GET", data: { q: request.term, key: "538fDui3019" }, dataType: 'jsonp', jsonp: 'callback', jsonpCallback: 'jsonCallBackPlaces', contentType: "application/json", success: function (data) { placeDataArray = eval(data); var array = new Array(); for (i = 0; i < placeDataArray.length; i++) { var custumPlaceObj = { label: placeDataArray[i].place + ", " + placeDataArray[i].state + " (" + placeDataArray[i].country + ")", placeObject: placeDataArray[i] }; array.push(custumPlaceObj) } response(array.slice(0, 10)); }, error: function (jqXHR, textStatus, errorThrown) { //console.log("jqXHR: " + jqXHR.status + "\ntextStatus: " + textStatus + "\nerrorThrown: " + errorThrown); } }); } }); $("#place1").autocomplete({ search: function (event, ui) { $(this).addClass("wait"); }, open: function (event, ui) { $(this).removeClass("wait"); }, response: function (event, ui) { $(this).removeClass("wait"); }, select: function (a, b) { $('#LatDeg1').val(b.item.placeObject.latDeg); $('#LatMin1').val(b.item.placeObject.latMin); $('#LatNS1').val(b.item.placeObject.latNS); $('#LongDeg1').val(b.item.placeObject.longDeg); $('#LongMin1').val(b.item.placeObject.longMin); $('#LongEW1').val(b.item.placeObject.longEW); $('#timeZone1').val(b.item.placeObject.timezone); }, minLength: 3, source: function (request, response) { $.ajax({ url: "https://asapi.astrosage.com/api/findplaces"/* + searchString */, type: "GET", data: { q: request.term, key: "538fDui3019" }, dataType: 'jsonp', jsonp: 'callback', jsonpCallback: 'jsonCallBackPlaces', contentType: "application/json", success: function (data) { placeDataArray = eval(data); var array = new Array(); for (i = 0; i < placeDataArray.length; i++) { var custumPlaceObj = { label: placeDataArray[i].place + ", " + placeDataArray[i].state + " (" + placeDataArray[i].country + ")", placeObject: placeDataArray[i] }; array.push(custumPlaceObj) } response(array.slice(0, 10)); }, error: function (jqXHR, textStatus, errorThrown) { //console.log("jqXHR: " + jqXHR.status + "\ntextStatus: " + textStatus + "\nerrorThrown: " + errorThrown); } }); } }); $("#place2").autocomplete({ search: function (event, ui) { $(this).addClass("wait"); }, open: function (event, ui) { $(this).removeClass("wait"); }, response: function (event, ui) { $(this).removeClass("wait"); }, select: function (a, b) { $('#LatDeg2').val(b.item.placeObject.latDeg); $('#LatMin2').val(b.item.placeObject.latMin); $('#LatNS2').val(b.item.placeObject.latNS); $('#LongDeg2').val(b.item.placeObject.longDeg); $('#LongMin2').val(b.item.placeObject.longMin); $('#LongEW2').val(b.item.placeObject.longEW); $('#timeZone2').val(b.item.placeObject.timezone); }, minLength: 3, source: function (request, response) { $.ajax({ url: "https://asapi.astrosage.com/api/findplaces"/* + searchString */, type: "GET", data: { q: request.term, key: "538fDui3019" }, dataType: 'jsonp', jsonp: 'callback', jsonpCallback: 'jsonCallBackPlaces', contentType: "application/json", success: function (data) { placeDataArray = eval(data); var array = new Array(); for (i = 0; i < placeDataArray.length; i++) { var custumPlaceObj = { label: placeDataArray[i].place + ", " + placeDataArray[i].state + " (" + placeDataArray[i].country + ")", placeObject: placeDataArray[i] }; array.push(custumPlaceObj) } response(array.slice(0, 10)); }, error: function (jqXHR, textStatus, errorThrown) { //console.log("jqXHR: " + jqXHR.status + "\ntextStatus: " + textStatus + "\nerrorThrown: " + errorThrown); } }); } }); $("#nextPage").click(function () { if (formValidation1()) { $("#boyDetails").hide(300); $("#girlDetails").show(300); } else { return false } }); }); function isUserBirthDateValid(userBirthDate) { var dateformat = /^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$/; // Match the date format through regular expression if (userBirthDate.match(dateformat)) { //Test which seperator is used '/' var opera1 = userBirthDate.split('/'); lopera1 = opera1.length; // Extract the string into month, date and year if (lopera1 > 1) { var pdate = userBirthDate.split('/'); } var dd = parseInt(pdate[0]); var mm = parseInt(pdate[1]); var yy = parseInt(pdate[2]); // Create list of days of a month [assume there is no leap year by default] var ListofDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; if (mm == 1 || mm > 2) { if (dd > ListofDays[mm - 1]) { return false; } } if (mm == 2) { var lyear = false; if ((!(yy % 4) && yy % 100) || !(yy % 400)) { lyear = true; } if ((lyear == false) && (dd >= 29)) { return false; } if ((lyear == true) && (dd > 29)) { return false; } } return true; } else { return false; } } function toggleAndChangeText() { $('#divToToggle').toggle(); if ($('#divToToggle').css('display') == 'none') { $('#aTag').html('[+] Coordinates and Advance Settings'); } else { $('#aTag').html('[−] Coordinates and Advance Settings'); } } function toggleAndChangeText1() { $('#divToToggle1').toggle(); if ($('#divToToggle1').css('display') == 'none') { $('#aTag1').html('[+] Coordinates and Advance Settings'); } else { $('#aTag1').html('[−] Coordinates and Advance Settings'); } } function toggleAndChangeText2() { $('#divToToggle2').toggle(); if ($('#divToToggle2').css('display') == 'none') { $('#aTag2').html('[+] Coordinates and Advance Settings'); } else { $('#aTag2').html('[−] Coordinates and Advance Settings'); } }