Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form request.getParamteter (Help please)

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0


Help!!!
I can't get the if statement to execute. I submit a form and one of the values for the form is 1. I submit and it does not notice the code. What am I doing wrong.
To better understand the code, here it is.
<%String Enter=request.getParameter(&quot;answer&quot;); %>

<% if (Enter == &quot;1&quot; ){ %>

answer is the parameter that I am bring from the form.

Thank you.
Curtis

 
Hello Kurtic19

Please try like this then you will not get any error

<% if (Enter.equals(&quot;1&quot;) ){ %>

but &quot;Enter&quot; is &quot;Null&quot; it will give null pointer exception so 1st check it like this

<% if( Enter!=null && Enter.equals(&quot;1&quot;)) {%>

ok if you had any more queries ask me at somasekhar@webveda.com

bye
soma sekhar

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top