I have a very weired problem (which is not easy to describe.. but I'll do my best):
I have a html page with several forms , only one of the got the action="ComputeAndReturn" and the other forms got only name="" tag...

the problem is that after i submit the form with the action , and than after a computatioon it returns to the original page, now... if i will submit any of the forms without the action=...

they will act as if they were defined action="ComputeAndReturn" (altho they are not!)

Now... if they were defined from the first time with action="anything", and than i would submit the form with action="ComputeAndReturn" this problem would not appear (the other forms will keep their action="anything" and would not "imitate" the action="ComputeAndReturn" to them selfs...

any ideas how can i keep my forms without action="" , cause all i need them to do is be submitted to pass the submitted value to other form inside that page....

it looks something like this...

function go()

 function gogo()

 function gogogo()

<form name="one" >
<select name="oneone" id="oneone" onchange="go()">

<form name="two" >
<select name="twotwo" id="twotwo" onchange="gogo()">

<form name="three" >
<select name="threethree" id="threethree" onchange="gogogo()">

<form name="four" action="ComputeAndReturn" >
<input type="submit" value="Add" name="Add" />

thanks ahead...


i am not getting same problem as you are getting as i tried, any way you try to put action="#"
hope it will help..!

I did tried action="#" , but it doesn't change anything... still the other forms tries to act as if they were defined with action="ComputeAndReturn"

i know that a part of the blame that this all happening is of ComputeAndReturn which is a servlet that returns something that messing all that html... but i'm looking for a solution that i will be able to apply on the html side only...

any other ideas?

instead of calling ComputeAndReturn directly can't you call a jsp file there you will take care of calling ComputeAndReturn.
you can also have hidden field on all the form with same name and at jsp file you can check the value of hidden field and on the basis of perform correct action.

thx 4 the suggestion ,but it doesn't fit my needs , cause i need to receive some data back from the servlet and to show it ....

form.submit() causes a form submit irrespective of whether that form has been assigned a real or dummy action. Plus on a page at a time only one form can be submitted. The best way here would be to rethink your design and encapsulate all the elements in the same form and perform the arbitration logic at the server itself.

action=none doesn't work also... after first form submitting of the "problematic form" all other forms starts to behave like it also.....

This article has been dead for over six months. Start a new discussion instead.