can not get value in the form

Posted on 2006-04-10
Last Modified: 2010-03-31
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">

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??????????????????????
Question by:keepworking
    LVL 92

    Expert Comment


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

    how are you checking whether u got the values?

    Author Comment

    hi, objects:

    I use break pointer to trace the values.

    LVL 92

    Accepted Solution

    are you getting null or blank?

    Author Comment

    LVL 92

    Assisted Solution

    is the checkbox checked?
    LVL 5

    Assisted Solution

    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.
    LVL 5

    Expert Comment

    and for dropdowns you need to associate a value foreach dropdown element as suggested earlier.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    Title # Comments Views Activity
    twoTwo  challenge 35 71
    method argument as final 1 54
    dividesSelf challange 15 58
    groovy example issue 10 32
    Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
    Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
    Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    737 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

    22 Experts available now in Live!

    Get 1:1 Help Now