473,385 Members | 1,597 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,385 software developers and data experts.

JavaScript validation of a DataList

Hello all,

I have a DataList control displaying data from the database (some products).
There are also TexBox controls and ImageButton controls in the two columns
of the DataGrid. I would like to implement client-side validation so that
when user clicks ImageButton (with add to basket function), JavaScript
checks if the correct string was entered in the aforementioned TextBox. All
this is usual and the JavaScript in itself is not a problem of course, but
how do I wire those ImageButton controls (in fact their OnClick events) to
JavaScript and how do I pass the value from TextBox control (DataList child
control) to JScript?

Many thanks,
Hrvoje
Nov 17 '05 #1
1 2376
You can use something like 'this.nextSibling.value', if the textbox is
rendered right after your button.

"Hrvoje Vrbanc" <hr*****@recro.hr> wrote in message
news:O8***************@tk2msftngp13.phx.gbl...
Hello all,

I have a DataList control displaying data from the database (some products). There are also TexBox controls and ImageButton controls in the two columns
of the DataGrid. I would like to implement client-side validation so that
when user clicks ImageButton (with add to basket function), JavaScript
checks if the correct string was entered in the aforementioned TextBox. All this is usual and the JavaScript in itself is not a problem of course, but
how do I wire those ImageButton controls (in fact their OnClick events) to
JavaScript and how do I pass the value from TextBox control (DataList child control) to JScript?

Many thanks,
Hrvoje

Nov 17 '05 #2

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

Similar topics

0
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...
1
by: Kevin | last post by:
Hi all, I'm now very frustrated, I've been battling all of today to try and understand the datalist, editing, inserting, updating, etc, I have managed to get most of that sort of stuff...
1
by: Nevyn Twyll | last post by:
I have a DataList; in the DataList's , I have a LinkButton and a few listboxes. When the LinkButton is pressed, I need to get the ID of the selected item in one of the Listbox controls. Then I...
1
by: moondaddy | last post by:
I have a datalist that makes use of the edit template. In this template I also have client side validation controls for required fields. My problem is that when I click on the cancel button it...
0
by: Chris Fink | last post by:
I have the need to perform some javascript code on a rendered datalist. However, the problem is that the objects that I want to control via javascript have been given unique names when the datalist...
6
by: john | last post by:
I have the following textbox setup with Text & ToolTip Bindings as follows; I'm using Visual Studio 2008 VB: <asp:TextBox ID="txtDay1" runat="server" Text='<%# Eval("Day1") %>'...
0
by: diff | last post by:
I am having trouble preventing a bound source from updating using event-driven validation. There is a very nice article on MSDN explaining this;...
4
by: Peter | last post by:
I have a DataList and each item in the datalist has an imge, I want to change the datalist item image on the client side when user clicks a button. How would I do that with JavaScript, does anyone...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.