attaching events to textbox in a grid....

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
 
A

Ashish M Bhonkiya

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
 
P

Peter Blum

Microsoft really has to document the CompareValidator better because
everyone misses it! It can validate integers, decimals, currencies, and
dates. Just set the Type property and Operator=DataTypeCheck.

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

Gill Smith

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
 
P

Peter Blum

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
 

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,733
Messages
2,569,440
Members
44,832
Latest member
GlennSmall

Latest Threads

Top