• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 204
  • Last Modified:

can not get value in the form

in 1.jsp

<form method='POST' action='2.jsp'>
<input class ="text" TYPE="text" NAME="email">
                                                                  
<INPUT TYPE="CHECKBOX" NAME ="auto_process" value ="Yes">
                                    
<SELECT NAME ="percentage">
<OPTION>100%</OPTION>
<OPTION>80%</OPTION>
</SELECT>      
</form>                        

in 2.jsp
String email              = request.getParameter("email");   //I can get email value
String auto_process              = request.getParameter("auto_process");       //but no value of auto_process
String percentage              = request.getParameter("percentage");     //but no value of percentage, why??????????????????????
0
keepworking
Asked:
keepworking
  • 3
  • 2
  • 2
3 Solutions
 
objectsCommented:
try:

<OPTION value="100%">100%</OPTION>



how are you checking whether u got the values?
0
 
keepworkingAuthor Commented:
hi, objects:

I use break pointer to trace the values.

thanks
0
 
objectsCommented:
are you getting null or blank?
0
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.

 
keepworkingAuthor Commented:
blank
0
 
objectsCommented:
is the checkbox checked?
0
 
mrigankCommented:
In case of checkbox, the checkbox name is passed as a request parameter only if the checkbox is checked. No specific value is passed.
If checkbox is not checked, you get a null. i.e. the checkbox is not submitted with the form.
If checkbox is checked, you get a blank, but the checkbox name is a part of the request  parameter it is submitted with  the form.
0
 
mrigankCommented:
and for dropdowns you need to associate a value foreach dropdown element as suggested earlier.
0

Featured Post

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.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now