473,385 Members | 1,597 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

attaching events to textbox in a grid....

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
Nov 18 '05 #1
4 1391
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

"smith Smith" <Sm********@hotmail.com1> wrote in message
news:el*************@TK2MSFTNGP12.phx.gbl...
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

Nov 18 '05 #2
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: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"smith Smith" <Sm********@hotmail.com1> wrote in message
news:el*************@TK2MSFTNGP12.phx.gbl...
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

Nov 18 '05 #3
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

"Ashish M Bhonkiya" <bh******@hotmail.com.nospam> wrote in message
news:eH**************@TK2MSFTNGP09.phx.gbl...
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

"smith Smith" <Sm********@hotmail.com1> wrote in message
news:el*************@TK2MSFTNGP12.phx.gbl...
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


Nov 18 '05 #4
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: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
"Gill Smith" <gi*******@hotmail.com> wrote in message
news:Om**************@tk2msftngp13.phx.gbl...
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

"Ashish M Bhonkiya" <bh******@hotmail.com.nospam> wrote in message
news:eH**************@TK2MSFTNGP09.phx.gbl...
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

"smith Smith" <Sm********@hotmail.com1> wrote in message
news:el*************@TK2MSFTNGP12.phx.gbl...
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



Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mike Burkhart | last post by:
I have written the following class to build a data grid textbox column that has the KeyUp and KeyPress events defined for the TextBox. I also defined the KeyDown event for testing purposes only. ...
5
by: | last post by:
I am wondering what the best method of attaching custom Events to custom WebUserControls are. I cannot seem to find the proper terminology to expand my research. Basicallly I have a custom user...
1
by: Gunjan Garg | last post by:
Hello All, I am working to create a generic datagrid which accepts a datasource(ListData - This is our own datatype) and depending on the calling program customizes itself for sorting,...
0
by: ariesc | last post by:
I upgraded from .NET 2002 to .NET 2003 and found one weird things on the LEAVE / ENTER events within a datagrid. I added handler to each textbox of a datagrid, then handle the ENTER/LEAVE events....
16
by: Tym | last post by:
I have a piece of code thus: For iLOOP = 0 To iNoDays - 1 For jLOOP = 0 To iMaxPeriods - 1 iX = 10 + (iLOOP * (dCellWidth + 10)) iY = 10 + (jLOOP * (dCellHeight + 10)) + Me.Size.Height / 4 If...
4
by: Jeff User | last post by:
Hi I tryed to solve this problem over in the framework.asp group, but still am having trouble. Hope someone here can help. using .net 1.1, VS 2003 and C# I have an asp.DataGrid control with a...
3
by: keithb | last post by:
My code dynamically adds template fields to a GridView control. Everything seems to work OK, except when updating, because I haven't found a way to reference the dynamically added textboxes....
0
by: BigAl.NZ | last post by:
Hi Guys, I am trying to write/copy some code that uses events with a GPS. Everytime the GPS position updates the event fires. The GPS code is from a SDK Library that I got called GPS Tools...
2
by: mrutyunjaya | last post by:
hello, i have two textbox column and one button control in gridvie when i click button it will ask plese enter price in first textbox . when enter values it is asking again. how to pass...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.