As a Javascript Noob I'm having a bit of problem writing some javascript that will dynamically update the 'action' of a form when the form is submitted.

Its for an Image Upload script which performs a binary read on the uploaded image, meaning I have to POST the form, but must pass any additional parameters to the Image Upload script via the querystring.

<form id="form5" name="form5" method="post" enctype="multipart/form-data" >
Caption:<input name="caption" type="text" id="caption" />  
File path: <input name="filepath" type="file" id="filepath" style="width: auto;" />
      <input name="Upload" type="submit" class="submit" id="Upload" value="Upload" onclick="submitform()" />

My submitform() function needs to set the action of form5 to :

"image-upload.asp?caption=[value of caption field]"
And submit the form.

Can anyone help?