HEX
Server: Apache/2.4.41
System: Linux mainweb 5.4.0-182-generic #202-Ubuntu SMP Fri Apr 26 12:29:36 UTC 2024 x86_64
User: nationalmedicaregrp (1119)
PHP: 8.3.7
Disabled: exec,passthru,shell_exec,system,popen,proc_open,pcntl_exec
Upload Files
File: /home/healthinsuranceguide/public_html/js/formFunction.js
function submitForm()
{
$('#submitButton').prop('disabled', true);
$.ajax({
	 type: 'post',
	 dataType:'jsonp',
	 url: 'https://ushaleads.healthinsuranceguide.org/api/LeadAPI',
	 data: $('form').serialize(),
	 success: function () {
	   console.log('success');
		 window.location.href = "form-success.php";
	   },
	   error:function(){
		 console.log('Error');
		 window.location.href = "form-success.php";
	   }

   })
};


$(document).ready(function(){
 $('input:checkbox').click(function() {
	 $('input:checkbox').not(this).prop('checked', false);
 });
});

	 /*-----------------------------------------------------------------------*/
	 /*----------------------- Phone Number Input Mask -----------------------*/
	 /*-----------------------------------------------------------------------*/

	 $(document).ready(function(){
		 $('#phone').mask('0000000000');
	 });

	 /*-----------------------------------------------------------------------*/
	 /*---------------------------- Zip Code Lookup --------------------------*/
	 /*-----------------------------------------------------------------------*/


	 $('#zipCode').on("input",function(){
		 var zipCode = $('#zipCode').val();
		 if(zipCode.length == 5)
		 {
			 $.ajax({
				 type: 'GET',
				 url:'https://ziplookup.visualyzers.com/Ziplookup?zipcode=' + zipCode,
				 success:function(results){
					 $('#city').val(results.city);
					 $('#state').val(results.state);
				 }

			 })
		 }
	 });

	 /*-------------------------------------------------------------------------*/
	 /*---------------------------- Validation Lookup --------------------------*/
	 /*-------------------------------------------------------------------------*/

	 $("#valForm").submit(function(e) {
		 e.preventDefault();
	 }).validate({

		 rules:{
			 phone:{
				 required:true,
				 minlength:10,
				 maxlength:10
			 },
			 firstname:{
				 required:true
			 },
			 lastname:{
				 required:true
			 },
			 dateofbirth:{
				 required:true,
				 date:true,
			 },
			 typeofplan:{
				 required: true
			 },
			 email:{
				 required:true,
				 email:true
			 },

			 city:{
				 required:true
			 },

			 state:{
				 required:true
			 },

			 zipCode:{
				 required:true,
				 minlength:5,
				 maxlength:5
			 }
		 },
		 messages: {
			 phone: {
				 required: "Please enter a valid phone number"
			 },

		 },

		 submitHandler: function(event)
  {
   
	submitForm();
  }
});


	 $(function() {
		 $( "#datepicker" ).datepicker({
			 dateFormat : 'mm/dd/yy',
			 changeMonth : true,
			 changeYear : true,
			 yearRange: '-100y:c+nn',
			 maxDate: '-1d'
		 });
	 });




	 /*-----------------------------------------------------------------------*/
	 /*--------------------------- Date of Birth  ----------------------------*/
	 /*-----------------------------------------------------------------------*/

	 $(document).ready(function() {
		 $.getJSON('https://api.ipify.org?format=jsonp&callback=?', function(data) {
			 $('#IpAddress').val(data.ip);
		 });

		 $.dobPicker({
			 daySelector: '#dobday',
			 /* Required */
			 monthSelector: '#dobmonth',
			 /* Required */
			 yearSelector: '#dobyear',
			 /* Required */
			 dayDefault: 'Day',
			 /* Optional */
			 monthDefault: 'Month',
			 /* Optional */
			 yearDefault: 'Year',
			 /* Optional */
			 minimumAge: 18,
			 /* Optional */
			 maximumAge: 100 /* Optional */
		 });
	 });
  



 window.dataLayer = window.dataLayer || [];
  $.dataLayer.push({
 'event':'ec_formsubmit',
 'enhanced_conversion_data': {
   first_name: $('#firstname').val(),
   last_name: $('#lastname').val(),
   phone_number: $('#phone').val(),
   email_address: $('#email').val(),
   street: $('#street').val(),
   city: $('#city').val(),
   postal_code: $('#zip').val(),
   dobday: $('#dobday').val(),
   dobmonth: $('#dobmonth').val(),
   dobyear: $('#dobyear').val(),     
   date_of_birth: $('#dob').val(),  
   plan_condition: $('.planConditions').val(),        
   plan_option: $('.planOption').val(),       
 }
})