View Single Post
Old 04-18-2004, 10:25 PM   #1 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,505
sde is on a distinguished road
trying to capture ""

Code:
<%
if( request.getParameters("name") == "" ) {
  out.println("No Name Selected");
}
%>
ok, really basic here i'm sure. i have a form with a text field 'name'. when there is nothing in that field, i want it to trigger the above if statment.

for some reason, i can not catch "" .. the value is NOT null either because i'm sending the field.

here would be the html form:
Code:
<form method=post action=test.jsp>
name: <input type=text name=name> <input type=submit name=submit value=submit>
</form>
how can i print 'no name selected' if someone submits the form without anything in it? ( no client side stuff )

so basic hehe, .. php spoils me.
__________________
Mike
sde is offline   Reply With Quote