EMI Calculator Ozone Promenade

EMI Calculator
Loan Amount
Loan Tenure (months)
Interest Rate
Interest payable
Total payable
Need Help?
$(document).ready(function() { $("#submit_btn").click(function() { var proceed = true; //simple validation at client's end //loop through each field and we simply change border color to red for invalid fields $("#contact_form input[required=required], #contact_form textarea[required=required]").each(function(){ $(this).css('border-color',''); if(!$.trim($(this).val())){ //if this field is empty $(this).css('border-color','red'); //change border color to red proceed = false; //set do not proceed flag } //check invalid email /* var email_reg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; if($(this).attr("type")=="email" andand !email_reg.test($.trim($(this).val()))){ $(this).css('border-color','red'); //change border color to red proceed = false; //set do not proceed flag } */ }); if(proceed) //everything looks good! proceed... { //get input field values data to be sent to server post_data = { 'name' : $('input[name=name]').val(), 'email' : $('input[name=email]').val(), 'phone1': $('select[name=phone1], input[name=phone1]').val(), 'phone' : $('input[name=phone]').val(), 'comment': $('textarea[name=comment]').val() }; //Ajax post data to server $.post('form/send.php', post_data, function(response){ if(response.type == 'error'){ //load json data from server and output message output = '
'; }else{ output = '
'; //reset values in all input fields $("#contact_form input[required=true], #contact_form textarea[required=true]").val(''); $("#divId #contact_body").slideUp(); //hide form after success } $(".ajaxanswer").hide().html(output).slideDown(); setTimeout("jQuery('.ajaxanswer').fadeOut('slow')",5000); }, 'json'); } }); //reset previously set border colors and hide all message on .keyup() $("#contact_form input[required=true], #contact_form textarea[required=true]").keyup(function() { $(this).css('border-color',''); $("#result").slideUp(); }); });