I have a textarea which is disabled by default. And then on press of 'Edit' I take some input from user. If it is valid, I want to enable the textarea. Here is the code which I have right now:
<textarea name="comment" cols="5" rows="2" disabled="true"><%= $tmp_com %></textarea>
<a href="javascript:validateUser()">Edit</a>
function validateUser(){
var name=prompt("Please enter the password");
if (name=="1234")
{
document.getElementByName("comment").disabled="false";
}
}