kwebster7327
asked on
Limit a Textbox to Numeric Only with CSS
Given a plain old asp textbox, is there a way to only allow numeric input using CSS. Can't find it in the book, but this seems like it should be obvious.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Kaufmed: almost a winner until I saw Zvonko's minimalist approach.
How is that an accepted solution when the code is broken? Okay... a slight nitpick... but here is a corrected version with the size options included.
<input type="text" name="Zipcode" onKeyUp="if(this.value.mat ch(/\D/))t his.value= this.value .replace(/ \D/g,'')" size="10" maxlength="5" />
<input type="text" name="Zipcode" onKeyUp="if(this.value.mat
There are tons of open questions where you can show how expert you are and you do here unsolicited posts? Where do you read here Zip was required except in your comment???
And you copied my code without to reference that it was MY solution!
Now you either apologise for your wrong extension or you show where my code was broken.
And you copied my code without to reference that it was MY solution!
Now you either apologise for your wrong extension or you show where my code was broken.
Zvonko: Whoa there! Calm down... Perhaps I should have put a smiley face on my response. But I am sorry if I offended you.
What I meant was the error was in missing the open quote before text. I had actually written more after the corrected code but, for some darn reason the rest of my message is not there.
You had wrote: [<input type=text"....]
When it should be [<input type="text"....]
BTW, this is a variation of the method I use but kudos to you. Your code contribution is more elegant than mine. That was something else that should have been in my response.
Can we live in peace now? :-)
What I meant was the error was in missing the open quote before text. I had actually written more after the corrected code but, for some darn reason the rest of my message is not there.
You had wrote: [<input type=text"....]
When it should be [<input type="text"....]
BTW, this is a variation of the method I use but kudos to you. Your code contribution is more elegant than mine. That was something else that should have been in my response.
Can we live in peace now? :-)
Uhps, that missing quote character I have not noticed. You are right, my apologies to you <|;-)
No prob. my original posting was misleading. I should have read it after I posted it.... then I would have noticed that 1/2 of it was missing. Take care! I'm going to sleep now. :-)
Open in new window