redho home | products | services

Programming Forums


Community for Java, PHP, Perl C, ASP and Python programmers
Thursday 18 October 2018 20:29

Ask your IT question here

valifating a number onchange



 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Programming Forums -> JavaScript forum
View previous topic :: View next topic  
Author Message
Koplaf
Enthusiastic Coder


Joined: 28 May 2006
Posts: 130
Can i validate a number onchange?
Reply with quote
 
Kopilman
Enthusiastic Coder


Joined: 25 May 2006
Posts: 162
Koplaf, in a text box?
Reply with quote
 
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, onchange = javascript
Reply with quote
 
Koplaf
Enthusiastic Coder


Joined: 28 May 2006
Posts: 130
Yup, text box
Reply with quote
 
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
 
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Programming Forums -> JavaScript forum


Dubai Forums - Expat Help | Vegan Forum | Java Programming | 3d Design Resources | 3d Forum | 3D Jobs | 3D Textures | Paris Forum | Europe Forum
Dubai Classifieds | Dubai Property | Jobs in Dubai | Free London Classifieds | Jobs in London UK

High Quality, Custom 3d animation and Web Design solutions Royal Quality Web Hosting Services Vegetarian and Animal Rights news

© 2018 RedHo