Here we go:
var setNonEditable=true;
var input =document.getElementById("InputId");
//#1 In this case - the value won't be save in the input field event it presents there
if(setNonEditable)
{
input .style.visibility = 'hidden';
}
else
{
input .style.visibility = 'visible';
}
//#2 The value will be saved even the input is not editable but value is in there
if(setNonEditable)
{
input .disabled = true;
}
else
{
input .disabled = false;
}Happy easy coding!
No comments:
Post a Comment