| Author |
how to take either String or numbers..in textbox
|
madhuri kunchala
Ranch Hand
Joined: Mar 30, 2010
Posts: 350
|
|
hi,
in my project...in one of the textbox...i need to take either numbers or NULL..im not getting any idea..can anyone help me out..here is my jsp code and js code..
login.jsp
login.js
and i need the output as
L-Acct. No.----> NULL
or
L-Acct. No.----> 123
thanks and waiting for the reply..
madhu.
|
 |
Chris Baron
Ranch Hand
Joined: Mar 21, 2003
Posts: 1049
|
|
Check out the function isNaN() (is not a number).
If isNaN(123) is false, it's a number.
|
 |
madhuri kunchala
Ranch Hand
Joined: Mar 30, 2010
Posts: 350
|
|
hi,
i didnt understand the reply..
|
 |
Chris Baron
Ranch Hand
Joined: Mar 21, 2003
Posts: 1049
|
|
Well you replace everything what's in your outer for-loop with:
If the AccNo must not begin with leading zeros, you can even replace the outer loop with a check for isNaN(chkLocalAccNoStr)
And before that all you check if chkLocalAccNoStr == 'NULL'.
If yes, you return true;
|
 |
 |
|
|
subject: how to take either String or numbers..in textbox
|
|
|