I have an input field that has today's date appearing onload. I also have a checkbox that clears the input field onclick. However, I'm hoping to have the original date field return if a user unchecks that box. Is this possible?
Checkbox HTML:
<span class = "required">*</span>$[SP]$[SP]<input type="checkbox" id="e_not_enroll" name="e_not_enroll"/>$[SP]$[SP] I do NOT want to enroll.
Date input box code:
<input type="text" id="d_date_of_event" value = "${jvar_employment_start_date}" style="background-color:#ddd" readonly="readonly"/>
if (document.getElementById("e_not_enroll").checked){
document.getElementById('d_date_of_event').value='';
} else {
document.getElementById('d_date_of_event').value = ?? ;
}