• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Validating a textfield to accept only numeric data...

icklejez

Member
Ive got a text field 'num1' that i want to validate so that it pops up a message when theres no numbers in it using Javascript...

all the tutorials on the web are far too complex and i was wondering if someone could help me understand what i need to put in my html document.

Thanks

 
Here's the one I use on one of our pages at our company, probably more elegant ways to do it, but this is the one I found that worked a long time ago.
Whatever function calls this, have it output an alert saying it wasn't numeric if the function returns 0.

 
Back
Top