?
Solved

issue with multiple forms in an html page

Posted on 2005-03-10
6
Medium Priority
?
134 Views
Last Modified: 2010-04-09
I have an HTML page that contains 2 forms. Here is a simplified representation of what the form structure looks like:

<form name="formA" action=./formA.jsp method="get">
<input type="Submit" name="InputFormA" value="SubmitA">
</form>

<form name="formB" action=./formB.jsp method="get">
<input type="Submit" name="InputFormB" value="SubmitB">
</form>

The problem I'm having is that when the button in Form B is clicked, a submit request is sent to formA.jsp. If I comment out the code for form A, then the form B button correctly submits to formB.jsp. I'm going to try to upload the actual code that is exhibiting the problem.
0
Comment
Question by:opike
6 Comments
 
LVL 32

Assisted Solution

by:Batalf
Batalf earned 248 total points
ID: 13510442
It works OK in my browser. When i click on SubmitB it sends me to formB.jsp.
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 13511284
put your action in quotes ... and make sure you have a closing </form> tag for form A before the opening <form tag for form B.
0
 
LVL 8

Assisted Solution

by:seb_gibbs
seb_gibbs earned 248 total points
ID: 13512401
Is what you posted exactly the same as what's in your page?  Sounds like you might have a slight error that is stopping the browser parsing the formB tag correctly.

I cant see no reason why this should not work.


   <form name="formA" action="formA.jsp" method="get">
   <input type="Submit" name="InputFormA" value="SubmitA">
   </form>

   <form name="formB" action="formB.jsp" method="get">
   <input type="Submit" name="InputFormB" value="SubmitB">
   </form>

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 33

Assisted Solution

by:knightEknight
knightEknight earned 252 total points
ID: 13512439
I agree ... perhaps you are missing a closing > or some other element in the first form.
0
 
LVL 5

Accepted Solution

by:
dougday earned 252 total points
ID: 13519962
Make sure you close all your tags, also.  It keeps browsers happy (especially in the future):

<form name="formA" action="formA.jsp" method="get">
  <input type="Submit" name="InputFormA" value="SubmitA" />
</form>

<form name="formB" action="formB.jsp" method="get">
  <input type="Submit" name="InputFormB" value="SubmitB" />
</form>

-Doug
0
 

Author Comment

by:opike
ID: 13607853
The problem had to do with how I had the first form nested inside a table definition. Thanks for all the suggestions - I spilt up the points 4 ways.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question