PK

ADDRLIN : /proc/self/root/home/bw2hgtn172qm/www/urologysolution.in/js/
FLL :
Current File : //proc/self/root/home/bw2hgtn172qm/www/urologysolution.in/js/tutorialapp.js

$(function() {

  $('.error').hide();
  $('input.text-input').css({backgroundColor:"#FFFFFF"});
  $('input.text-input').focus(function(){
    $(this).css({backgroundColor:"#FFDDAA"});
  });
  $('input.text-input').blur(function(){
    $(this).css({backgroundColor:"#FFFFFF"});
  });

  $("#sub").click(function() {
		// validate and process form
		// first hide any error messages
    $('.error').hide();
		
	var name = $("input#name").val();
		if (name == "") {
      $("label#name_error").show();
      $("input#name").focus();
      return false;
    }
	var age = $("input#age").val();
		if (age == "") {
      $("label#age_error").show();
      $("input#age").focus();
      return false;
    }


var selected = $("input[type='radio'][name='gender']:checked");
if (selected.length > 0)
    gender = selected.val();
	
//alert(gender);
/*
	var gender = $("input#gender || input#gender1").val();
			if (gender == "") {
		  $("label#gender_error").show();
		  $("input#gender[]").focus();
		  return false;
		}
*/
		var phone = $("input#phone").val();
		if (phone == "") {
      $("label#phone_error").show();
      $("input#phone").focus();
      return false;
    }
	
	var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
	var email = $("input#email").val();
		if (email == "") 
		{
      $("label#email_error").show();
      $("input#email").focus();
      return false;
    }
	else if(!emailReg.test(email)) {
				//$("label#email_error").html('');
				//$("input#email").html('<span class="error" id="email_error">Please enter your valid ID.</span>');
				$("label#email_error1").show();
				$("input#email").focus();
				return false
			 
			}
		var symptoms = $("textarea#symptoms").val();
		if (symptoms == "") {
      $("label#symptoms_error").show();
      $("input#symptoms").focus();
      return false;
    }
		
			var timings = $("select#timings").val();
		if (timings == "") {
      $("label#timings_error").show();
      $("input#timings").focus();
      return false;
    }
	
		var popup_container = $("input#popup_container").val();
		if (popup_container == "") {
      $("label#datetime_error").show();
      $("input#popup_container").focus();
      return false;
    }
		
		
		var dataString = '&name='+ name + '&age='+ age + '&gender=' + gender + '&email=' + email + '&phone=' + phone + '&symptoms=' + symptoms + '&timings=' + timings + '&datetime=' + popup_container;
		//alert (dataString);
		//return false;
		
		$.ajax({
      type: "POST",
	  
	  //url:"inbox/index.php"
      url: "../bin/processapp.php",
      data: dataString,
      success: function() {
        $('#contact_form').html("<div id='message'></div>");
        $('#message').html("<h4>Appointment Form Submitted!</h4>")
        .append('<p>Thank you '+ name + ' for your request. Your information has been received and a representative will contact you shortly. </p><br/><br/><br/>')
        .hide()
        .fadeIn(1500, function() {
          $('#message').append("<img id='checkmark' src='images/email_accept-128.png' /><br/>");
        });
      }
     });
    return false;
	});
});
runOnLoad(function(){
  $("input#Contact").select().focus();
});
function isNumberKey(evt)
      {
         var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode > 31 && (charCode < 48 || charCode > 57))
            return false;

         return true;
      } 


PK 99