JavaScript validation of a DataList

  • Thread starter Thread starter Hrvoje Vrbanc
  • Start date Start date
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
 
You can use something like 'this.nextSibling.value', if the textbox is
rendered right after your button.
 
Back
Top