473,394 Members | 1,645 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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
Nov 19 '05 #1
1 991
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" <ne*********@gmail.com> wrote in message
news:uX**************@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

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Carlo Marchesoni | last post by:
I have a UserControl that builds a Tree-View Menu using Javascript. This UC does not run as a ServerControl Then, in every aspx page I include this UC. Everything works perfect, except that if I...
5
by: Lau Lei Cheong | last post by:
Hello, I'm writing a usercontrol to be included in my project. The usercontrol have a few javascript function to do the client-side tasks. However, the controls on the usercontrol seems to...
2
by: Jimmy | last post by:
Hi How do you refer from you webpage to a usercontrol which contains a n html control with javascript? usercontrol contains: <input id="tb1" name="tb1" type=text>
5
by: tshad | last post by:
I get an error when running my Javascript inside my UserControl. It works fine if I put the UserControl Data directly in my Web Page. The stripped down code is: <script language=javascript>...
2
by: jyanmin.fang | last post by:
Hi, In my current project, I need to embed an .NET winform usercontrol in the aspx page (via <Objecttag). This winform usercontrol has an event called DoEvent (void DoEvent()). This winform...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.