Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Guys,

I have to define a textbox in html whose maximum size should be 3.Now If
I am entring -100 then these are 4 characters but I want that user should allow
to enter 100 or -100.If I define size="3" then it will not allow -100.

so i want to know can we define size of the textbox dynamically,i.e. if I enter
- sign then size will increase to 4 else it should be 3.

can we do this using js?

Thanks & regards,

Arvind
Posted

1 solution

u can test whether the user entered '-' or not
if he enters '-' then check the length according u r requirement
its easy i think

sorry, if i misunderstand
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900