I’ve an asp.net page having a server side submit button and 2 textboxes which accept only numeric values.Am also using asp.net validation controls.
If the user types in non-numeric data in both the textboxes, how do i show only 1 error message on the page saying:
“Only numeric values are allowed.”
And I want to achieve this without firing a server side event.
Thanks.
Well obviously you’ll need to do this with javascript.
I don’t know the exact javascript methods to check if input is numeric, I’m guessing you can use a regex. But you could have a hidden div such as
Then you can do:
of course this is “pseudocodish” but I think this will work for you once you find the way javascript can check for valid numbers and just place that in the IsNumber function