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

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIClient-side ValidationClient-side Validation
Previous
 
Next
New Post
11/15/2005 6:38 AM
 

Is there any example of how to use the ClientAPI to register scripts which do client-side validation and actually work?  It seems that the names of the objects are different on the client-side than on the server side, so I am not sure how such code would work.  I am referring to Javascript code which does the validations on the client side.  For example, if I put a textbox control on my module called txtValidText, it usually ends up on the client side with a name like dnn_ctrl377_txtValidText (or something like that).  So, how would my Javascript code know how to reference the control?

I have messed around with this forever and can't figure out a way to do it.  Would appreciate any help that anybody can offer.

Tks,
Joe

 
New Post
11/15/2005 9:49 AM
 

The problem you are running into is due to the use of usercontrols in DotNetNuke.  In fact, it is not really a problem, but a feature.  In your example you have a module with a textbox named txtValidText.  Lets say that ASP.NET didn't prefix your control with dnn_ctrl377_.  What would happen to your script if someone placed two instances of your module on the page at the same time?  You would end up with a control array.  To work around this problem/feature you need to have your script be aware of the UniqueID of its container.  This information (usercontrol.uniqueid) can be sent down to the client through the getVar/setVar functionality detailed in the ClientAPI document (page 9-10) or in some custom way.  However, you need to still think through what happens if two modules exist on the same page.

Hope you find this useful.

 


 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIClient-side ValidationClient-side 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