Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

AppTheory specializes in solutions based on the DotNetNuke platform and has 2 employees on the DotNetNuke Core Team.
  Ads  
Active Modules -- Active Forums for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
SmarterTools
Verndale
The Official Microsoft ASP.NET Website
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  ClientAPI Compo...  Client-side Validation
Previous Previous
 
Next Next
New Post 11/15/2005 3:38 AM
User is offline joe harrison
1 posts
10th Ranked


Client-side Validation 

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 6:49 AM
User is offline Jon Henning
1623 posts
www.codeendeavors.com
5th Ranked










Re: Client-side Validation 

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 Previous
 
Next Next
  Forum  DotNetNuke® Pro...  ClientAPI Compo...  Client-side Validation
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Disgrafic
Diseño y creación de portales web dinámicos :: Desarrollo de módulos personalizados :: Soluciones a medida :: Imagen Corporativa :: Tu proveedor DNN en España
www.disgrafic.com
DM Analytics, LLC
DM Analytics, LLC provides software solutions that facilitate rapid development of independent or dependent datamarts and their associated web-based reporting.
www.dmanalytics.com
Integral Hosting | DNN only $14.95/month
Experienced .NET hosting on Windows 2003, ASP.NET 1.1 & 2.0, MSSQL with real technical support.
www.integralhosting.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP