Laura,
What I do is place a blank option tag in my query-driven select field, like
so, making sure that it is selected by default:
<cfselect name="state" size="1" value="state">
<option value="" selected></option>
</cfselect>
Then in your action page:
<CFIF State IS "">
Error! You must select a state!
<CFABORT>
</CFIF>
Terri
----Original Message Follows----
From: LH Rothman <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: CF Talk <[EMAIL PROTECTED]>
Subject: CFIF Questions
Date: Thu, 24 Aug 2000 21:34:57 -0700
Hello!
I want to force folks to select a state but I'm using CFSELECT and the
required tag doesn't work with it. Consequently I'm attempting to
modify the CFIF statement on my action page with little success. I've
tried this:
<CFIF IsDefined("State") IS "No">
Error! You must select a state!
<CFABORT>
</CFIF>
but it doesn't work. The ultimate goal is to require folks to select at
MINIMUM a state in this search and give them an error if they select
nothing. I know I'm making a stupid mistake and and any help would be
very appreciated!!!
Thank you,
-Laura
An Apparent Newbie!
-- My Action page in progress--
<CFQUERY DATASOURCE="lcn" NAME="Contacts">
SELECT Zip, City, County, State, Business, Phone, Fax, Website, Email,
Street1, Legal, Comments
FROM Contacts
WHERE Legal LIKE '1'
<CFIF Business IS NOT "">
AND Business LIKE '#Business#%'
</CFIF>
<CFIF City IS NOT "">
AND City LIKE '#City#%'
</CFIF>
<CFIF County IS NOT "">
AND County LIKE '#County#%'
</CFIF>
<CFIF Zip IS NOT "">
AND Zip LIKE '#Zip#%'
</CFIF>
<CFIF State IS "">
AND State LIKE '#State#%'
</CFIF>
ORDER BY Business
</CFQUERY>
<HTML>
<HEAD>
<TITLE>Search Results</TITLE>
</HEAD>
<body BGCOLOR="white">
<P><CENTER>
<FONT FACE=ARIAL SIZE=+1>
<CFOUTPUT>Found #Contacts.RecordCount# Matches</CFOUTPUT>
</font></CENTER>
<P>
<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=90% ALIGN=CENTER>
<CFOUTPUT QUERY="Contacts">
<TR>
<TD VALIGN=TOP><FONT FACE=Arial SIZE=-1>
<b>#Business#</b></FONT><BR>
<FONT FACE=Arial SIZE=-1>#Street1#<CFIF Len(Trim(Street1)) IS
0>N/A</CFIF><BR>
#City#, #State# #Zip#<BR>
PH: #Phone#<CFIF Len(Trim(Phone)) IS 0>N/A</CFIF><BR>
FX: #Fax#<CFIF Len(Trim(Fax)) IS 0>N/A</CFIF><BR>
Web: #Website#<CFIF Len(Trim(Website)) IS 0>N/A</CFIF><BR>
Email: <A HREF="mailto:#Email#">#Email#</a><CFIF Len(Trim(Email)) IS
0>N/A</CFIF>
</FONT></TD><TD VALIGN=TOP><FONT FACE=Arial
SIZE=-1><i>#Comments#</i></FONT><BR></td>
</TR>
</CFOUTPUT>
</TABLE>
</P>
</BODY>
</HTML>
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.