getting values
[nobr]Hi,
I have a question which is related to forms and hope someone and can help me.
I have a form which first asks you if you are male or female then displays a separate form based on selection.
out.println("<form method=\"post\" action=\"");
out.println(this.getClass().getName() +"\">");
out.println("<input type=\"radio\" name=\"sex\" value=\"Female\">");
out.println("Female <br>");
out.println("<br>");
out.println("<input type=\"radio\" name=\"sex\" value=\"Male\">");
out.println("Male<br>");
out.println("<br>");
out.println("<input type=\"Submit\" name=\"Submit\" value=\"Submit\">");
out.println("</form>");
In the post method I do the following
String getstr=request.getParameter("sex");
if(getstr.equals("male"));
{
out.println("<form method=\"post\" action=\"");
out.println(this.getClass().getName() +"\">");
out.println("<input type=\"text\" name=\"Name\" value=\"Username\">");
out.println("Username <br>");
out.println("<br>");
out.println("<input type=\"password\" name=\"password\" value=\"Password\">");
out.println("Password<br>");
out.println("<br>");
out.println("<input type=\"Submit\" name=\"Submit\" value=\"Save\">");
out.println("</form>");
}
else
{
// will display some different text fields
}
My question is how do I access the values the user entered in the "Username" and "Password" of the Male Form ?
Waiting for your replies,
thanks,
@debug[/nobr]

