Menu
Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Frontpage Newsgroups
Frontpage Programming
Javascript question...
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="116, post: 3970397"] I have this script to maintain a 4 character entry done with a hidden field, but i have an issue with people putting leading zeros. How can I have an alert when a leading zero is entered and exit the script? <script> function sortdashno() { with (document.forms[0]) { { if (DASHNO.value.substr(0,1) = 0) alert("Please remove leading ZERO"); else if (DASHNO.value < 10) DASHNOSORT.value = "000" +DASHNO.value; else if (DASHNO.value > 10 && DASHNO.value < 100) DASHNOSORT.value = "00" +DASHNO.value; else if (DASHNO.value > 100 && DASHNO.value < 999) DASHNOSORT.value = "0" +DASHNO.value; } } } </script> Thanks David [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Frontpage Newsgroups
Frontpage Programming
Javascript question...
Top