Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET Javascript jQuery , +
Dear Experts,
 
I am Stuck in my Asp.net project,
 
I am Using JQuery Validation in my project.. And i have Include some Javascript files and also a small piece of javascript code in my Index.aspx page.. Here is the below Code....
 
 $('form').validationEngine();
 
And When i click the submit button it validates the fields.
 
One of the Javascript file contains a function to validate. And it returns a boolean, if the form get error then it returns False else True.....
 
I just put an alert in that function and i successfully got the return boolean.
 
Here is the Below Code.. (This code is in "jquery.validationEngine.js" file)
 
_onSubmitEvent: function () {
		   
			var form = $(this);
			var options = form.data('jqv');
			options.eventTrigger = "submit";
 
			// validate each field 
			// (- skip field ajax validation, not necessary IF we will perform an ajax form validation)
			var r=methods._validateFields(form);
 
			if (r && options.ajaxFormValidation) {
				methods._validateFormWithAjax(form, options);
				// cancel form auto-submission - process with async call onAjaxFormComplete
				return false;
			}
 
			if(options.onValidationComplete) {
				// !! ensures that an undefined return is interpreted as return false but allows a onValidationComplete() to possibly return true and have form continue processing
				return !!options.onValidationComplete(form, r);
			}
			
			return r;
			
		},

 

I need to get this return boolean in my Index.aspx page.....
 

Is there any Javascript code to get the return value....
 
Please help me..
 
Thanks and Regards,
 
Dileep.....
Posted 3-Apr-13 8:29am
dilzz1.2K
Comments
ryanb31 at 3-Apr-13 15:02pm
   
I am confused. Where do you want the return value? Your code is already returning r or false, or !!options...
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hello,
 
Rather than attaching the validation engine to a form you can use .validate method in your own submit handler. That way you can chose to take an appropriate action based on the return value. See doc here[^]
 
Regards,
  Permalink  
Comments
dilzz at 4-Apr-13 1:06am
   
Thank You Sir.... Its Working..... Thanks a lot... :)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hi
You Can Refer This Website for validation engine
 
http://www.aspdotnet-suresh.com/2012/01/jquery-beautiful-popup-form-validations.html[^]
 
Regards,
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 325
1 Sergey Alexandrovich Kryukov 289
2 CPallini 275
3 DamithSL 260
4 Maciej Los 215
0 OriginalGriff 5,455
1 DamithSL 4,422
2 Maciej Los 3,860
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,010


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 4 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100