homepage Welcome to WebmasterWorld Guest from 107.20.34.144
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Form values sent only after validation
toplisek

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4643037 posted 5:16 pm on Feb 6, 2014 (gmt 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');

}
});
});

 

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved