> > <select name="selectbox"
> > onChange="javascript:document.forms.form[0].submit"> roughly, IIRC. for
> > the first form on the page, of course.

not quite.

> Another way (this is off the top of my head) would be:
>
> <form method="POST" action="/search" name="drop_down_form">
> <select name="selectbox"
> onChange="javascript:document.drop_down_form.submit">
> <option value="..">....</option>
> ...
> </select>
> </form>

closer, but still not quite.

Both miss one minor detail. document.forms[0].submit() is a function not a
variable. Miss those parentheses off and you'll be going nowhere. However,
with the <input type=submit> button, it will automatically submit the form
it's associated with, in order to differentiate between different submit
buttons, you'll need to name the buttons and check to see whether the
button.x or button.y co-ordinates have been set. If you wanted to have an
image as a button the following could also be done:

<a href="javascript:document.forms[0].submit()"><img src="myimgae.png"
border=0></a>

HTH,
Barbie.


Reply via email to