|
valifating a number onchange
|
| View previous topic :: View next topic |
| Author |
Message |
Koplaf Enthusiastic Coder
Joined: 28 May 2006 Posts: 130
| |
Kopilman Enthusiastic Coder
Joined: 25 May 2006 Posts: 162
| |
Koplaf Enthusiastic Coder
Joined: 28 May 2006 Posts: 130
|
I wanna do something like onchange="javascript:if(isNaN(parseInt(document.form.input.value, 10))) {alert"Not a number";};"
And it doesn't work :(
Reply with quote
|
| |
|
|
Kopilman Enthusiastic Coder
Joined: 25 May 2006 Posts: 162
| |
Koplaf Enthusiastic Coder
Joined: 28 May 2006 Posts: 130
| |
Kopilman Enthusiastic Coder
Joined: 25 May 2006 Posts: 162
|
You dont need the javascript: there
And you can replace document.form.input.value with this.value
Reply with quote
|
| |
|
|
Koplaf Enthusiastic Coder
Joined: 28 May 2006 Posts: 130
|
<td> <input type=text name="telefon" value="" size=20 onchange="if (isNan(parseInt(this.value, 10))) { alert('Help'); }" /> </td>
Doesn't work
My js should bring up an alert on input change
Reply with quote
|
| |
|
|
|