Solved

Posting Data from Form - But all fields are null when processing

Posted on 2004-07-30
4
234 Views
Last Modified: 2010-04-01
I am submitting the following form:
<form name="mainForm" method="post" action="index.jsp" enctype='multipart/form-data'>

with this submit button:
<input name="submit_form" type=submit value="Save" onClick="javascript:document.mainForm.submit();">

But when I get to the processing page, all of the field variables are null, for example:
<%
   String $subtitle = request.getParameter("subtitle"); //This is a field in the form
   out.println(" Subtitle_index=" + $subtitle);
   String $submit_form= request.getParameter("submit_form"); //This is the actual submit button
   out.println(" SubmitButton=" + $submit_form);
%>
Returns: "Subtitle_index=null SubmitButton=null"

I have temporarily changed the method to get, and all of the values in the fields show up in the URL, but when I make the method post, I get back a bunch of nulls.  

Am I missing something simple here?

Thanks,
Michael
0
Comment
Question by:mderbin
4 Comments
 
LVL 2

Expert Comment

by:k41d3n
ID: 11681567
Use get not post.

You are getting the values froma  post. not posting values from a  post.
0
 

Author Comment

by:mderbin
ID: 11682538
But I wasn't wanting all of the data to be displayed in the URL, and it has the potential to be VERY long, so the characters in the URL will certainly run over at times.  

So I was under the impression that I would need to use a "post" method in my form.
0
 
LVL 27

Accepted Solution

by:
rrz earned 50 total points
ID: 11682592
>enctype='multipart/form-data'  
If you use that then you need necessary code at server to parse the multipart request.  You could use  
http://jakarta.apache.org/commons/fileupload/    
Are you uploading a file  ?
0
 
LVL 4

Expert Comment

by:Oliver_Dornauf
ID: 11704282
The input type submit or button have no _value_ you c! If you use java script to submit your form (i.e you need multiple submitt buttons or do some client side validation) you should use the input type button.


0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

A procedure for exporting installed hotfix details of remote computers using powershell
Are you unable to connect or configure Hotmail email account in Microsoft Outlook 2010, 2007? Or Outlook.com emails are not downloading to Outlook? Lets’ see the problem and resolve Outlook Connector error syncing folder hierarchy (0x8004102A).
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

758 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now