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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Totally Confused - Please help..

Status
Not open for further replies.

faiyth

Programmer
Nov 22, 2002
19
US
This would be my code:
<%
v_yesno=request.getParameter(&quot;f_yesno&quot;);
if (v_yesno == &quot;yes&quot;)
{
do code A
}
else
{
do code B
}
%>
<input type=radio value=&quot;yes&quot; name=f_yesno> YES
<input type=radio value=&quot;no&quot; name=f_yesno> NO
</body>
</html>

When someone chooses YES on the form, and submits the form my IF statement is not recognizing the value &quot;yes&quot;.. but when I spit out the value of v_yesno it's value is &quot;yes&quot;. So I'm unsure why my if statement is not seeing the &quot;yes&quot;. What am I doing wrong?
 
>> if (v_yesno == &quot;yes&quot;)

change to

if( v_yesno.equals(&quot;yes&quot;))


-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top