Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

checking the entry

Status
Not open for further replies.

discusmania

IS-IT--Management
Oct 24, 2000
158
AP
Hello....
I have a text box. The content of the text box should be only numeric value. what should i do if i want the user to be prompt a message box , whenever the input is non-numeric value?

Thanks

NOR
 
use client side vbscript or javascript. javascript is probably a better option as it works cross-browser.

you can use this if you want.

<script>
function checkInput(str)
{
var regex = /^\d$/g;
if(!regex.test(str))
{
alert('you can only have numeric values in this text box');
return false;
}
return true;
}
</script>

then in your form tag...

onsubmit=&quot;check(document.formname.elementname.value);&quot;
adam@aauser.com
 
Thanks... but what i want is at the moment the user move from the text box to another text box, the message will be prompt out. it is like the change event in vbscript. is the any vbscript solution for this. can we use change event in asp same like in VB code?.

Thanks ....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top