Click here to Skip to main content
15,921,716 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

How to change a label in to a text box using java script?

Thanks,
Posted

1 solution

The best way is to have both controls and at start hide the textbox.
Then switch visibility (label invisible, textbox visible and value copied from label)

other approach is to postback, but you want to do it client side...
 
Share this answer
 
Comments
sreenathpktr 11-Oct-11 3:43am    
Thank you.Yeah...i applied visible and invisible way to the label before posting here.It works fine.I need to know that how to hide the text box when the page loads.Please suggest code in java script.
MZwahlen 11-Oct-11 3:56am    
i would do it at serverside with textbox.Attributes.Add("visible","false");

on clientside it can be done too, but its more difficult. The best approach is with jQuery at the $(document).ready{} method

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