JavaScript validation of a DataList

H

Hrvoje Vrbanc

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
 
M

Marina

You can use something like 'this.nextSibling.value', if the textbox is
rendered right after your button.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,108
Latest member
AlbertEste
Top