473,387 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Requesting data from multiple forms which have the same action

Hi,
I'm using an HTML page in which i've 2 forms which have the same action..
Ex:

<form name="f1" action="store.jsp" method="post">
<!-- Do something -->
</form>
<form name="f2" action="store.jsp" method="post">
<!-- Do something -->
</form>

Now in the JSP page how can i retreive the parameters of form f2 using request.getParameter('Parameter name');
Is there any method like request.getParameter(form name,parameter name);
(or)
form_name.request.getParameter(Parameter_name);

Help me out please..
Dec 31 '10 #1
2 2455
AutumnsDecay
170 100+
Why not append action to your url?

Example:

Expand|Select|Wrap|Line Numbers
  1. <form action="store.jsp?action=form1" method="get">
  2.     ...more code...
  3. </form>
  4.  
  5. <form action="store.jsp?action=form2" method="get">
  6.     ...more code...
  7. </form>
  8.  
Then on your jsp page you can have it process differently based on the action that was set in the url, similar to PHPs ability which is:

Expand|Select|Wrap|Line Numbers
  1. if ($_GET['action'] == "form1"){
  2.    process this code...
  3. }
  4.  
  5. if ($_GET['action'] == "form2"){
  6.     process this code instead...
  7. }
  8.  
Jan 3 '11 #2
well thank u very much for your valuable suggestion. but can i use both actions for processing a single set of statements
regards,
rakhi
Jan 3 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Terri | last post by:
I have form1.asp which contains a form which is posted to and processed by a page called process.asp. I want to create a second form on form2.asp and also post it to process.asp. On process.asp I...
1
by: Chris Beach | last post by:
Hi, I have a JSP page with several forms on it. Some of these forms are generated dynamically, and each of them submits some information to a database. Handling one form is easy, as I can...
6
by: Davids | last post by:
this was impossible to implement on old ASP, is it the same for .Net?
7
by: Jeff | last post by:
I plan to write a Windows Forms MDI application for a medical office. Users must be able to select a patient and view related information on multiple forms; with1-4 forms opened at the same time...
5
by: c676228 | last post by:
Hi everyone, my colleagues are thinking about have three insurance plans on one asp page: I simplify the plan as follow: text box:number of people plan1 plan2 plan3
4
by: darnnnel | last post by:
I have a combobox for retrieving patient records. If I have several patients with the same last name, the combobox always retrieves the first patient with this last name, not necessarily the one...
4
by: TazaTek | last post by:
Hi, I'm wanting to create a form that will take in some information, and return 2 (or more) pages in new tabs. I didn't know if this would be a better server side, or client side application. ...
2
by: =?Utf-8?B?VGFtbXkgTmVqYWRpYW4=?= | last post by:
Hi, I am going to write a large application using Visual Studio C#. I am going to use only one Form as main menu and go to other pages by cliking on next button in each page. I dont want to create...
1
by: chintan85 | last post by:
Hi guys, I want to pass multiple forms to different scripts. Lets say. Can u please help me.. <form action="pass1.py" method="post" name="Submit"> <input name="gene" type="checkbox"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.