attaching events to textbox in a grid....

  • Thread starter Thread starter smith Smith
  • Start date Start date
S

smith Smith

I have attached java script code for the text box in the bind event of a
grid for a template column.
Even though I can attach the java script to the text box but could not
achieve the full java script implementation. I want to add java script
validation so that user can enter only the numeric values in this field.
How to do that ?
smith
 
Hi smith,

Have to tried adding a regular expression validator for your textbox in the
datagrid. I think this should suffice.
you need not do extra validation using javascript, just add a proper regular
expression depending on your requirements.

HTH
Regards
Ashish M Bhonkiya
 
I have a special requirement where in when the user enters DD I am adding
"/" to the text box, when the user completes MM, I am adding "/"... so that
I am helping the user to enter date data very fast. My application is data
entry intensive.
Thanks,
Smith
 
FYI: I am the author of a very popular datetextbox with popup calendar,
Peter's Date Package (http://www.peterblum.com/datecontrols/home.aspx). Its
text entry capability addresses the same issue as you but handles it
different. Just let the user type 01042003 and when they exit the field, it
inserts the date separators (01/04/2003) based on the short date pattern. I
encourage you to download my control (free trial version and very cheap when
its purchased) because it does so much: handles all kinds of browsers,
allows missing elements in the date like typing 1/04 will figure out the
year for you.

Only IE provides enough power to handle the fill in as you go model. If you
work with more browsers, this approach works with them all.

--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
 
Back
Top