Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Javascript from an UserControl (http://www.velocityreviews.com/forums/t104876-javascript-from-an-usercontrol.html)

Paperback Writer 06-17-2005 12:37 PM

Javascript from an UserControl
 
Hi All,
I need to validate fields from my user control in the onload...the problem
is that my fields come with the name of the usercontrol followed by
textfield's name, for example: UserControl1:TextName

I need to validate for example:

onload="MyFormatFunction(document.frm1.UserControl 1:TextName.value)";

That returns an error...How do i accomplish that ?

--
Please, check my theSpoke:
http://www.thespoke.net/MyBlog/dgroh/MyBlog.aspx



Karl Seguin 06-17-2005 12:50 PM

Re: Javascript from an UserControl
 
Unless you can use the asp.net validation control, it's certainly a little
tricky and messy.

I've always done it ala:

document.frm1.<%=TextName.ClientId%>.value;

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Paperback Writer" <newsgroupms@gmail.com> wrote in message
news:uXHwYmzcFHA.3912@TK2MSFTNGP15.phx.gbl...
> Hi All,
> I need to validate fields from my user control in the onload...the problem
> is that my fields come with the name of the usercontrol followed by
> textfield's name, for example: UserControl1:TextName
>
> I need to validate for example:
>
> onload="MyFormatFunction(document.frm1.UserControl 1:TextName.value)";
>
> That returns an error...How do i accomplish that ?
>
> --
> Please, check my theSpoke:
> http://www.thespoke.net/MyBlog/dgroh/MyBlog.aspx
>





All times are GMT. The time now is 08:35 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.