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??????????????????????
keepworkingAsked:
Who is Participating?
 
objectsCommented:
are you getting null or blank?
0
 
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
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.