Hi,
Explanation: At the beginning the value of the field is YYYY-MM-DD. if the user delete the value and doesn't type anything, the button "ok" should be disabled. if the user delete the value and type new value, the button "ok" should be enable. The code is working only for the second case.
function ChangeOkButton()
{
if(document.getElementById('fromDate').value == null)
{ document.getElementById('save').disabled = true; }
else {document.getElementById('save').disabled = false; }
}
<input type="text" name="fromDate" id="fromDate" value="YYYY-MM-DD" onkeypress="ChangeOkButton();"/>
Is this possible?
Thank you!