I have some javascript set up to hide a part of a form (Question 2) depending on the response to another part of the form (Question 1).

This works fine on an 'Add record' page - the script is called using 'onchange' on Response 1.

However, I also want this behaviour on an Update page, which displays a user's current responses. I want the script to be called onchange and also onload (in fact, once the page and the current responses have loaded). As it stands at present, if the current response is such that Question 2 should not be hidden, the only way to make Question 2 appear is to change the response then change it back again, since the script is only called 'onchange'

My CSS file contains this:

#govpdf {
display: none;
}

I have this in the head:

<script type="text/javascript">
function check(Question1) {
if (document.getElementById) {
var style_govpdf = document.getElementById("govpdf_form").style;
}
if (Question1 == "Yes") {
style_govpdf.display = "block";
}
else {
style_govpdf.display = "none";
}
}
</script>

And this is the relevant code in the body (I've simplified the questions for clarity!):

<form action="somepage" method="POST">
<div>
Question 1: Do you have a pet?
<select name="Question1" size="2" onchange="check(this.value)">
<option value="Yes" Selected></option>
<option value="No"></option>
</select>
</div>
<div id="govpdf">
Question 2: Is your pet a dog?
<select name="Question2" size="2" onchange="check(this.value)">
<option value="Yes" Selected></option>
<option value="No"></option>
</select>
</form>

I have already tried using <body onload="check();"> and putting <script>window.onload=check();</script> at the bottom of the page but neither work. I am no expert in javascript, I was hoping someone would know what I should do, having searched around I can find lots of help for doing what already works above (for a 'New Record' sort of page) but nothing about an 'Update Record' page.

Many thanks in advance.