June 27th, 2001, 05:38 PM
I would like to have a select list that, upon clicking of an option, calls a servlet with method Post. I am trying to avoid the use of a submit button. Is this possible?
I have used the onChange attribute on the select list, and it successfully calls the servlet. However, it is using the Get method so I am losing my request parameters.
Can anyone help?
June 28th, 2001, 09:54 AM
Do document.forms.submit in your onChange (I suppose your form declaration takes care of the method and target)
or add a querystring when you go for that GET method
June 29th, 2001, 10:42 AM
That document.forms.submit didn't do anything even though the form does have the servlet name and method post. It seems like a logical solution.
I tried quotes, no quotes, index 0 and index 1...
June 29th, 2001, 10:51 AM
Ok, your document should resemble:
<FORM ACTION="servlet_whatever" METHOD="POST">
<SELECT NAME="myListbox" onChange="foo();">
<OPTION VALUE="1">Option 1</OPTION>
<OPTION VALUE="2">Option 2</OPTION>
it's document.forms because a document can contain several <FORM></FORM> declarations... so document.forms is a collection and  is used for indexing
June 29th, 2001, 11:14 AM
It was the missing parens that had me.
Thank you for your help...