Welcome to WebmasterWorld Guest from 107.21.163.40

Forum Moderators: open

Message Too Old, No Replies

Form values sent only after validation

     
5:16 pm on Feb 6, 2014 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:Oct 25, 2006
posts: 1010
votes: 0


I guess code like:
JQuery.validator.setDefaults({
submitHandler: function(form) {
form.submit();
}
});
jQuery(function() {
jQuery(".myform1").validate({

above validation will prevent sending form values if form is submitted and validation TRUE and confirmed message is shown on separate page. If user refreshes browser on this page it will not be sent form values unless browser message is clicked to confirm that form values will be resended

Is this correct script and ID's like .myform1 is not mentioned inside function(form)...
Need help.

I have seen some sample:
$(document).ready(function(){
$("#signin_form").validate({
debug: false,
rules: {
///
},
messages: {
///
},
submitHandler: function(form) {
var result;

$.post('test.php', $('#signin_form').serialize(), function(data){
result = $.parseJSON(data);

if (result.flag == 'false'){
$('#results').show()
}
})
.success(function(data){
if (result.flag == 'true'){
form.submit();
}

}, 'json');

}
});
});