Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datagrid - when in edit mode can I interact with Javascript events

Status
Not open for further replies.

StuckInTheMiddle

Programmer
Mar 3, 2002
269
US
HI there,

I had a datagrid bound to my dataset and have the appropriate edit template setup so that users can make changes and submit them. And all is well in the world, except they want some client side validation on the inputs.

Can i attach a javascript to the onblur event for instance of the textbox that gets shown on my edittemplate to say validate a date. This no need to go back to the server. Kinda almost like a validation control.

A,


"If you can stay calm, while all around you is chaos...then you probably haven't completely understood the seriousness of the situation.
 
Yes, you can. If you've created the TextBox inside the template then just add the onblur event to it as you would normally (the only issue you may encounter is that you will have to use the CliebtID property of the TextBox in order to get a reference to it in javascript). Alternatively, you can use a Validator control in the same manner as you normally would.


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top