?
Solved

issue with multiple forms in an html page

Posted on 2005-03-10
6
Medium Priority
?
130 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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. …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
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…
Suggested Courses

800 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