J
Jason Novotny
Hi,
I'm trying to create a listbox using <select> HTML tags that can do
a form submit when an option in the list is selected. So far this works,
function MySelectSubmit() {
document.myform.submit();
}
with HTML:
<form name="myform" method="post" action="myselect">
<select name='myselect' size='1' onChange='MySelectSubmit()'>
<option value='hi' selected='selected' >Hello</option>
<option value='bye'>Goodbye</option>
</select>
</form>
Now my question is how can I make the javascript method general enough
so I can pass in any form so that it does not have to refere to "myform"
in the body. I tried the following but it doesn't work:
function MySelectSeubmit( aform ) {
document.aform.submit();
}
Thanks, Jason
I'm trying to create a listbox using <select> HTML tags that can do
a form submit when an option in the list is selected. So far this works,
function MySelectSubmit() {
document.myform.submit();
}
with HTML:
<form name="myform" method="post" action="myselect">
<select name='myselect' size='1' onChange='MySelectSubmit()'>
<option value='hi' selected='selected' >Hello</option>
<option value='bye'>Goodbye</option>
</select>
</form>
Now my question is how can I make the javascript method general enough
so I can pass in any form so that it does not have to refere to "myform"
in the body. I tried the following but it doesn't work:
function MySelectSeubmit( aform ) {
document.aform.submit();
}
Thanks, Jason