Welcome to WebmasterWorld Guest from 50.19.53.104

Forum Moderators: open

Message Too Old, No Replies

Form values sent only after validation

     

toplisek

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

WebmasterWorld Senior Member 5+ Year Member



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');

}
});
});
 

Featured Threads

Hot Threads This Week

Hot Threads This Month