form submit not sending inputs
1 posts in topic
Flat View  Flat View

Posted By:   Becky_Givner
Posted On:   Wednesday, December 19, 2001 12:09 PM

Form inputs are not being sent to my servlet when I call "onsubmit". The form in question has method="post". The form has several different inputs. The form is submitted by clicking a button with type="submit".

If I just submit the form, all is as expected. However, if I call a JavaScript function first with

onSubmit="return somefunction()"

the inputs are not in the servlet request parameters.

The form is generated from an XSL stylesheet, so I am pretty certain that there are no missing tags.

Why is this happening?

Re: form submit not sending inputs

Posted By:   Arun_Bharathan  
Posted On:   Wednesday, December 19, 2001 02:06 PM

It is the javascript( Or more specifically the implementation of it in the browser!). After executing the somefunction() method, it is not properly handing the flow back to form Submit process of the browser (This is so dependent on the Browser) .

Change the onSubmit and it should work :)

onSubmit="return somefunction();return true;"

I usually use input with type=button and use onClick to do the JS function and in the end of the function add a document.form.submit()
About | Sitemap | Contact