How to get a values
Dear sir,
I have a one form with a multipart/form-data as follows
<form action="../jsp/newMESWithUpload.jsp" method="post" name="upform" enctype="multipart/form-data">
<table align="center" width="100%">
<tr>
<td>To</td>
<td><input type="text" name="to"></td>
</tr>
<tr>
<td>From</td>
<td><input type="text" name="from"></input></td>
</tr>
<tr>
<td>Subject</td>
<td><input type="text" name="subject"></input></td>
</tr>
<tr>
<td>Attach</td>
<td><input type="file" size="48" name="file" accept="text/html"></input></td>
</tr>
<tr>
<td>CC</td>
<td><input type="text" size="53" name="cc"></input></td>
</tr>
<tr>
<td>Bcc</td>
<td><input type="text" name="bcc"></input></td>
</tr>
<tr>
<td>Message</td>
<td><textarea rows="5" cols="40" name="matter">
</textarea></td>
</tr>
<center><tr>
<td><input type="submit" value="Send"></input></td>
</tr></center>
</table>
</form>
When i submit a form ,inother jsp i.e newMESWithUpload.jsp
in that jsp if i do
strSubject=request.getParameter("subject");
strFrom=request.getParameter("from");
strMatter=request.getParameter("matter");
Iam getting a null value aprt from a attachmented file,so how to get a other values ,please help me sir...
Thanks and Regards
Harini Veerapur.
View Answers
June 9, 2010 at 5:59 PM
Hi Friend,
Try the following code:
<%@ page language="java" %>
<html>
<SCRIPT LANGUAGE="JavaScript">
function submitForm(f){
var form = document.createElement("form");
with(form) {
method = "post";
action = "get.jsp";
name = "form";
id = "form";
style.display = "none";
}
for(var ix = 0; ix<f.length;ix++)
addForm(document.getElementById(f[ix]), form);
document.body.appendChild(form);
form.submit();
}
function addForm(frmCollectFrom, frmCollector) {
var frm = frmCollectFrom.elements;
for(var ix = 0 ; ix < frm.length ; ix++)
frmCollector.appendChild(frm[ix]);
return frmCollector;
}
</SCRIPT>
<form METHOD=POST ACTION="get.jsp" NAME="form1" id="form1">
<table>
<tr>
<td>To</td>
<td><input type="text" name="to" ></td>
</tr>
<tr>
<td>From</td>
<td><input type="text" name="from"></input></td>
</tr>
<tr>
<td>Subject</td>
<td><input type="text" name="subject"></input></td>
</tr>
<tr>
<td>CC</td>
<td><input type="text" size="53" name="cc"></input></td>
</tr>
<tr>
<td>Bcc</td>
<td><input type="text" name="bcc"></input></td>
</tr>
<tr>
<td>Message</td>
<td><textarea rows="5" cols="40" name="matter">
</textarea></td>
</tr>
</form>
<FORM NAME="form2" id="form2" ENCTYPE="multipart/form-data" ACTION="get.jsp" METHOD=POST>
<table>
<td>Attach</td>
<td><input type="file" size="48" name="file" accept="text/html"></input></td>
</tr>
</table>
</FORM>
<INPUT TYPE="button" value="Submit" onClick="submitForm(Array('form1','form2'))">
</HTML>
Thanks
Related Tutorials/Questions & Answers:
How to get a values - JSP-ServletHow to
get a values Dear sir,
I have one input text field and one submit button .Within one file
how to
get a
values within a same jsp.
Thanks and Regards
Harini Veerapur. Hi Friend,
Try the following
Advertisements
How to get a values - JSP-Servlet getting a null value aprt from a attachmented file,so
how to
get a other
values...
How to
get a values Dear sir,
I have a one form with a multipart/form-data as follows
To
From
Subject
how to get a values from processRecord - JSP-Servlethow to
get a
values from processRecord dear sir,
i have a problem in getting a
values from java to jsp.Here jsp is used to read a excel sheet that intern call a java program so i want a column
values i.e a column contains
How can I get query string values in JavaScript?How can I
get query string
values in JavaScript?
How can I
get query string
values in JavaScript?
To
get a query string value, you can use JQuery and JavaScript.. here is the code:
function getParameterByName(name
get values from Excel to databaseget values from Excel to database hi i want to insert
values from Excel file into database.Whatever field and contents are there in excel file... express 2005.
how can i do with java code
Get values from session to arrayGet values from session to array Hello
I have stored my 2 dimensional array into session using C#.net. Now on aspx page i want to store same session variable into 2 dimensional array. And
how to find count of session valaiable
Get values from session to arrayGet values from session to array Hello
I have stored my 2 dimensional array into session using C#.net. Now on aspx page i want to store same session variable into 2 dimensional array. And
how to find count of session valaiable
get date picker values to a textboxget date picker
values to a textbox I am using DatePicker to select date in a form in asp.net using c#. I need the picked data to
get in to a textbox. Please help me soon
Get values in drop down listGet values in drop down list Pls provide me jsp code to
get values in drop down list from another table's field.
my project has customer registration and company registration pages..... when i insert data in company
How to get Keys and Values from HashMap in Java?How to
get Keys and
Values from HashMap in Java? Example program of
iterating... to iterate the keys and
get the
values and print on the console.
How to
get keys... to iterate through keys and
get the
values. So, let's see
how to
iterate
Get the color values as a matrix of color imageGet the color
values as a matrix of color image I am new to java and image processing, i want to
get the color
values as a matrix from the color image for giving input to the compression algorithm by using java. plz provide
Get All Keys and Values of the Properties files in JavaGet All Keys and
Values of the Properties files in Java... to
get all keys and
it's
values of the properties files in Java. Java provides... to be inserting in the
properties files.
Here, you will
get the all keys and
values Get values from JSP pages - JSP-ServletGet values from JSP pages I have welcome.jsp in which it has...
I need to
get the value of those column names(First Name, Second... or input fields.
Hi Friend,
Do you want to pass the column
values Java Swing Set And Get ValuesJava Swing Set And
Get Values
In this tutorial we will learn about
how to set and
get values using setter
and getter methods. This example explains you
how... a simple example which will demonstrate you about
how to use
setter and getter
I cant get values in MS acces in tables I cant
get values in MS acces in tables I got problem in sending
values from servlet .
* i am using ms acces
* i cant display my
values but der... into registration (username,lastname,email,reemail,password,gender,dob)
values how to get HTTP GET request value using javascripthow to
get HTTP
GET request value using javascript
how to
get HTTP
GET request value using javascript
how is
how you can
get HTTP
GET...( "?", "" ); // will return the
GET parameter
var
values = parameter.split
can pass list of n values in session and get in jspcan pass list of n
values in session and
get in jsp In dao:
am geting username,companyname,usertype and set to userBean and add to arraylist...")!="")
{
%>
i have to
get value from currentUser list.and assign to a variable
can pass list of n values in session and get in jspcan pass list of n
values in session and
get in jsp In dao:
am geting username,companyname,usertype and set to userBean and add to arraylist...")!="")
{
%>
i have to
get value from currentUser list.and assign to a variable
How to get Button Id ?How to
get Button Id ?
How to
get Button ID instead of its value in Servlet.
(I am not using jsp right now
how to get radio value how to
get radio value
how to retrive the option value and insert the next table pls
give example
Getting Cell Values in a JTable;
In this tutorial, you will learn
how to
get the cell.... If you want to set the cell
values, use the setValueAt() method
and want to
get...
This program helps you to
get the cell
values in a JTable.
This program creates a JTable
How to get project pathHow to
get project path my problem is,i have one jar file,in that one xml is their,i am adding this jar file to my project,my question is
how i can open or
get that xml path
How to get project pathHow to
get project path my problem is,i have one jar file,in that one xml is their,i am adding this jar file to my project,my question is
how i can open or
get that xml path
How to get Java SDKHow to
get Java SDK Hi,
I have purchased a new computer and installed windows 7. Now I have to
get the Java SDK and install on my computer for developing and testing Java programs.
So, can anyone tell me
How to
get Java SDK
how to get UIView by taghow to
get UIView by tag In IOS application
how to
get a view by the tag id?
Thanks
Hi,
You can
get this with the help of the function 'viewWithTag''.
Following example code is getting the UILabel object from
not able to get values from jsp file - JSP-Servletnot able to
get values from jsp file hi thanks for u feedback,
her am sending the file jsp and servlet but in the servlet file am not able to
get the value by using method request.getParameter(). it shows null value,but if i
How to get factorial in mysqlHow to
get factorial in mysql Hi,
In order to improve the speed of my queries, one in particular tries to find matches between multiple tables, I am trying to use prime numbers to speed the process, but I have been googling
How to Get this OutputHow to
Get this Output 1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
Done It
public class star
{
public static void main(String[] args)
{
for(int i=1;i<=5;i
How to get the Day nameHow to
get the Day name Hi,
I am a beginner in Java and new to this web world as well. have a requirement to implement in my assignment project as below:
We need to add the days in input date such that it create the date
How to get data datagrid ?How to
get data datagrid ?
How to
get data datagrid in jsp from arrayList in java?
Code in java
CategoryDao dao = new CategoryDao();
ArrayList<Categories> lstCategory = new ArrayList<Categories>