473,699 Members | 2,384 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

datalists, validation and javascript

I have added some javascript to a button which is built in the
MyDataList_Item Created event. It produces the following code which works (ie
the EnableValidator s function fires):

<input type="submit" name="btn2" value="Button" onclick="if
(typeof(Page_Cl ientValidate) == 'function') Page_ClientVali date(); "
language="javas cript" id="btn2" OnMousedown="En ableValidators( 'Group2_');" />

So I tried the same thing for a button contained in a datalist and it
produces the following code:

<input type="submit" name="MyDataLis t:_ctl1:edit_Bu tton" value="Edit"
onclick="if (typeof(Page_Cl ientValidate) == 'function')
Page_ClientVali date(); " language="javas cript"
id="MyDataList_ _ctl1_edit_Butt on"
OnMousedown="En ableValidators( 'editGroup_');" />

This doesn't work (ie the function EnableValidator s does not fire. I am
pretty sure the reason is that in the first example the id and name attribute
are the same but in my datalist example they are different. Becuase I dont
seem to have any control over how the id and name are generated in a datalist
I am lost.

Does anyone have an answer of even an alternative method for achieving this.

Thanks

Jul 21 '05 #1
0 1083

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

Similar topics

16
2237
by: Hosh | last post by:
I have a form on a webpage and want to use JavaScript validation for the form fields. I have searched the web for form validation scripts and have come up with scripts that only validate individual fields, such as an "Email Validation Script" or a "Phone Validation Script". Is it ok to put all these scripts on page as they are or should they be joined in some way together to be one script? I'm a total JavaScript newbie and am completely...
6
1111
by: Jonathan Hollinger | last post by:
Very, very strange problem. In developing a C# ASP.NET application, every so often, DataLists disappear from the build. They remain visible and rendered (though sometimes dropping properties and event handlers) but do not seem to be included in the build (and are consequently not rendered on the web page). I've looked into the problem throughly, comparing output library sizes and it seems as though DataLists (all datalists on a page)...
6
3701
by: Nedu N | last post by:
Hi, I want to have confirmation(Yes/No) on a button of the webform in which there are many validation controls. I want all the validation controls to be triggered first and then Yes/No confirmation message. By adding just an confirm attribute for 'onclick' event of the button doesn't work with validation controls. Is there any short way to go around this. Thanks Nedu
14
6299
by: Matt | last post by:
I want to know if ASP.NET Web Forms Validation Controls are Server-Side or Client-Side form validation? Since I think each validator control can select either 1) JavaScript based error dialog or 2) show the error message next to the control. For example, if the text field is empty with RequiredField Validator control, it can show the value in ControlToValidate property in two ways as I mentioned. Please advise. Thanks!
4
10145
by: usl2222 | last post by:
Hi folks, I appreciate any assistance in the following problem: I have a form with a bunch of dynamic controls on it. All the controls are dynamically generated on a server, including all the validators. The user enters the data, presses OK. My OK button is dynamically generated as well, with some code-behind logic in
2
1351
by: Nathan Sokalski | last post by:
I have a page on which I want to display several sections each of which contain a list of names. I have two database tables, one of which contains the section headings, and the other contains the names and which section they belong to. I would like to use databinding to display this information, preferably using DataLists. However, because the number of sections will vary, the DataLists will need to be added dynamically. But because...
0
289
by: rufus | last post by:
I have added some javascript to a button which is built in the MyDataList_ItemCreated event. It produces the following code which works (ie the EnableValidators function fires): <input type="submit" name="btn2" value="Button" onclick="if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); " language="javascript" id="btn2" OnMousedown="EnableValidators('Group2_');" /> So I tried the same thing for a button contained in a...
2
1071
by: Diffident | last post by:
Hello All, I have a question on datalists. I have 5 datalists on a page and when I try to view the "ViewSource", the value for the __VIEWSTATE is empty. How do datalists persist their values? I am not binding the datalist each and every time. Strangely whenever I try to access datalist elements from Datalist_ItemCommand it is maintaining it's viewstate. How is this possible?
2
2388
by: Ole V.-M. | last post by:
Greetings, i have a UserControl, that contains a DataList. That DataList contains as items other DataLists. example: DataList A Row 1 Nested DataList 1 Row 1
0
8685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9172
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8908
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8880
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6532
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4374
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2344
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.