Menu
hello.
i’m new to javascript, and trying to code something that seems easy, i got stuck.
what i want to do is:
if you enter anything except numbers in a form and you click this button “send” to send the info, a window will pop up saying “enter numbers only”.
this is the code i have:
function validatephone(){
if(document.form.phone.value!=’????’){
alert(“Enter numbers only.”);
return false;
}
is that the right way? if it is, what should i enter in ???? so it will accept numbers only?
if that’s wrong, what’s the right way?
i hope someone comes with help. thanks!