To incorporate the onchange option in the input tag, include an intermediate function that checks and calls planhide() accordingly:
<input type="checkbox" id="icd" name="icd" value="icd" onchange=verify()/>
Create the verify() function to check the state and call the function like this:
function verify()
{
if(document.getElementById("icd").checked==false)
planhide();
}
Alternatively, you can utilize onclick on the submit button to trigger the check() function as shown below:
<input type="button" onclick=verify()/>