Click here to Skip to main content
15,920,513 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hai
anyone please help me.

I want to see a Textbox by default Readonly when i click button it will allow to give values.The textbox will appear same place

What I have tried:

<!DOCTYPE html>


<meta charset="ISO-8859-1">
<title>Insert title here


function setFocusToTextBox(){
document.getElementById("mytext").focus();
}





CLICK FOR EDIT
Posted
Updated 23-Jan-17 23:44pm

1 solution

You will have to use readonly attribute with your input control to mark control has a readonly. On click of a button, using javascript you can remove this attribute.

Readonly Textbox : - Mark textbox readonly[^]

Remove Attribute : Remove Attribute using Javascript[^]

Thanks,
Ashwin
 
Share this answer
 
Comments
suresh gopineni 24-Jan-17 6:44am    
you Didn't reach my question.Please follow the question and post 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