Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesJQuery Form ValidationJQuery Form Validation
Previous
 
Next
New Post
4/25/2010 5:17 AM
 

Hi All,

I'm trying to use JQuery Validation Plugin to do some client side validations in a DNN module. I haven't use JQuery at all and please bear with me if I sound very novice.

The tutorials in the web suggest that you invoke the validate method for the form within the "jQuery(document).ready" event, like this;

    jQuery(document).ready(function() {
        jQuery("#uxFormName").validate();
    });

My questions are;

1. The jQuert(document).ready" gets invoked once the HTML is fully rendered in client side after a postback, so how can we use this method for client side validations, which should happen prior to a postback?

2. Since a DNN module do NOT have access to the form, will it be work if I select individual controls (eg; Textbox) and invoke validate on them? (Already tried without success)

Cheers

Creed.

 
New Post
4/26/2010 5:33 PM
 

Hi Everyone,

I found answers to my queries.

1. The jQuery(document).ready can get invoked prior to post back upon a submit request by the jQuery framework it self. The use of the class 'submit' for the submit button does this.

2. The form name of a page generated by DNN seem to be 'Form'. So the code looks like;

jQuery("#Form").validate();

Thank you all.

Creed.

 
New Post
5/3/2010 5:43 PM
 

I would question your use of anything other than the built in ASP.NET validators because of the following reason: The ASP.NET validators are designed so that they work on both the client and server side.

It is entirely possible for an unscrupulous user to bypass client side validations and submit invalid values to the server. With the ASP.NET validators, this is a non-issue as the server will repeat any validations. if you use any other validsation library, you should really be mirroring the validations on the server.

If you really want extra functionality not currently offered by the ASP.NET validators, you may consider sub-classing them.

 

In answer to your questions below, I think you'll find that the jQuery code you quoted doesn't actually invoke the validations, but simply "hooks" up the validations - this .validate() method call is a common jQuery pattern.. Not knowing this particular library, I'd say it's adding even handlers to your controls in the background, ready for your blur and submit events.

 

 
New Post
7/13/2010 2:18 PM
 
I do not agree with you @Grant. ASP.Net validators need to be programmed from .Net and a framework cms as DNN is not too flexible with that. It has all sense that all javascript resources a programmer may use for the presentation logic, may be done via open stable and very powerful javascript frameworks as jquery. At last, everything a client side ASP.Net programmed validator does is to put its own javascript inflexible code inside the page. You have much more control of it if you use frameworks as jquery, yui, mootools, etc. regards. And by the way, thank you uchitha for the solution.
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesJQuery Form ValidationJQuery Form Validation


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out