Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
I am working on MVC 5,

After select country from dropdownlist, getting countrycode then set value in the textbox like this,
[^]

What I have tried:

then, how can I set the country code that can't be removed from the textbox, then enter mobile number?
[^]

Please help me
Posted
Updated 9-Apr-17 17:35pm

Put the area code before the texbox so they just type their number in, then in the back-end you can re-add the area code if you need to.

<span>+91</span> <input type=text name=phone/>
 
Share this answer
 
Comments
Afzaal Ahmad Zeeshan 9-Apr-17 8:13am    
5ed. Good solution.

Just saying, it might also be handy to set the span as a label, so when user clicks on it they are focussed to the input field. :-)
check this JSFiddle[^]
 
Share this answer
 
v2
Comments
Rajesh Kumar 2013 10-Apr-17 0:54am    
Sir, but I have a different design with input type textbox. Then How can apply the '+91' inside textbox? here is fiddle for actual design.

http://jsfiddle.net/pZLcg/499/
Karthik_Mahalingam 10-Apr-17 3:04am    
show your design, will modify accordingly
Rajesh Kumar 2013 10-Apr-17 3:14am    
here is the design, https://s15.postimg.org/5iorowp4b/image.png

Rajesh Kumar 2013 10-Apr-17 3:33am    
Sir, It is fixed. Thank you.
Karthik_Mahalingam 10-Apr-17 3:40am    
Welcome

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