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  |  

$4.95 Windows Hosting at Webhost4life.com
  Ads  
Aspose - The .NET & Java component publisher
 


  Sponsors  

Meet Our Sponsors

WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
OnyakTech
The best choice for your web site host, email hosting, and domain registration.
CrystalTech Web Hosting™
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Javascript Validation and DNN Control Names
Previous Previous
 
Next Next
New Post 7/18/2008 1:39 PM
Resolved
User is offline Bradley Molzen
58 posts
www.vinocellar.com
10th Ranked


Javascript Validation and DNN Control Names 

Hello,

I'm using a client side javascript custom validator so I can get the validation summary(which is also client side) to work correctly.

In my javascript code, I'm trying to use the "name" of the control I'm validating.

However, the "name" will be different on every portal I install the module on because DNN puts it's own naming on the control.

For example, it's calling my checkbox control:

 

dnn_ctr395_InformaticaRequestNew_cbEmergency

Is there a better way to find the control I want to validate, so I don't have to edit the .ascx page for every installation of the module?  (Test, Dev, Prod, etc.)

There are so many controls on this page, that using the index of the control is also quite difficult.

Thanks!

 
New Post 7/18/2008 2:37 PM
Accepted Answer 
User is offline Baatezu
193 posts
9th Ranked


Re: Javascript Validation and DNN Control Names 

use <%= CONTROLNAME.ClientID %> instead of hard coding the value. That should work in most instances of javascript on an aspx page.

I'm not sure your exact situation so it may not work. I've only used the ASP validators, and they do the control name to clientid automatically for me. :)

 
New Post 7/21/2008 9:49 AM
User is offline Mitch Sellers
5692 posts
www.mitchelsellers.com
3rd Ranked




Re: Javascript Validation and DNN Control Names 

The above recommendation is the best way to go.  It will work in all installations without issue.


-Mitchel Sellers
MCITP, MCPD, MCTS
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Consulting Quotes, and DNN Technical Support Services

I reccomend 3Essentials for shared hosting and BaseCamp for project management
 
New Post 7/22/2008 1:16 AM
User is offline Agung Riyadi
100 posts
9th Ranked


Re: Javascript Validation and DNN Control Names 

If you work with external javascript, then you can use this tool : http://code.msdn.microsoft.com/RegClientControls

Nice tool.

HTH.

 
New Post 7/22/2008 1:08 PM
User is offline Bradley Molzen
58 posts
www.vinocellar.com
10th Ranked


Re: Javascript Validation and DNN Control Names 

Thanks everyone for the replies.   This worked perfectly.... 

Example for my checkbox:

document.form.<%=cbEmergency.ClientID%>.checked

 

 1 Reports
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Javascript Validation and DNN Control Names
 


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.

 


Digicon: DotNetNuke design and development
Digicon is based in Brisbane, Queensland, Australia
digicon.com.au
Live Visitor Tracking & Live Chat For DotNetNuke
Track your visitors in real time and add live chat for sales & support. Free Trial.
www.whoson.com
SINA101
WANT A SPECial sIte iN TAIWAN?
sina101.com

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