>What's the best way to make sure the users only enter numbers in the web page textboxes? My options I think are:
>
>1. Running a jscript to check each field just prior to form submission and prompt the user to enter only numbers.
>2. When posting entered data, call a function to convert all values to numeric.
>
>I have a form with 50 textboxes that should only have numbers when it's posted and unsure from standpoint of accuracy and performance which method is best.
In VBScript the abs() function will strip out all non-numeric data.
Use event-bubbling and in the onClick event in the body tag call a function. In that function get the: window.event.srcElement.id
Then, in a switch statement, if the id is one of your numeric fields, execute a test and alert the user in a cumulative messagebox text field.