2forza Posted January 13, 2006 Share Posted January 13, 2006 Hi, I need a little help,I'm not very good in programming tho (My one of the serious attempt:P)How do I aplly only numbers? (max. 10)if (document.formulier.telefoonnummer.value == "") { document.getElementById('telefoonnummer').innerHTML = "please insert your phonenumber"; document.getElementById('8').innerHTML = "!";}else{if (document.formulier.telefoonnummer.value.length < 10) { document.getElementById('telefoonnummer').innerHTML = "please insert a valid phonenumber!"; document.getElementById('8').innerHTML = "!";What shall I do?Thanks and sorry for bad English Link to comment Share on other sites More sharing options...
Vel Straty Posted January 13, 2006 Share Posted January 13, 2006 Check out this page for your reference.I think it has what you need to accomplish your needs.Advanced JavaScript StuffYou might want to use the parseInt() and isNaN() functions or whatever you call them inorder to check if it is a number or not.andif your numbers, since its a phone number, might include hiphens "-" and / or "(", ")" inside them, use the str.replace() function to accomplish it.Have Fun! Link to comment Share on other sites More sharing options...
2forza Posted January 13, 2006 Author Share Posted January 13, 2006 Thanks, this might become handy... reading right now Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now