Not entirely sure what you are asking.
What about
<cfif pagetopic.recordcount>
<INPUT type="submit" name="button" value="Edit Specs">
<cfelse>
There are no topics.
</cfif>
-----Original Message-----
From: Scot VanAlstine [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 17, 2005 9:19 AM
To: CF-Newbie
Subject: stopping an empty submit
I have a window where a user can pick a topic and click an edit button.
If the window is empty and does not contain something to select they can
still click on the "Edit Spec" button and it gets an error. How would I
disable the "Edit Spec" button if there is nothing to select?
Thanks in advance for any help anyone can provide.
My code is below.
<body>
<CFQUERY NAME="pagetopic" DATASOURCE="#application.webtools#">
SELECT class_id, title FROM org_class
WHERE org_id = '#cookie.organization#'
AND class_type > 1
ORDER BY title
</CFQUERY>
<FORM method="post" action="specchoice.cfm" name="">
<TABLE border="0">
<TR>
<TD>
<CFSET #pagetopic_count# = 0>
<SELECT name="class_id" size="5">
<CFOUTPUT query="pagetopic">
<CFIF #pagetopic_count# is 0>
<OPTION value="#class_id#" SELECTed>#title#
<CFSET #pagetopic_count# = 1>
<cfelse>
<OPTION value="#class_id#">#title#
</CFIF>
</CFOUTPUT>
</SELECT>
</TD>
<TD align="right"><INPUT type="submit" name="button" value="Edit
Specs">
</TD>
</TR>
</TABLE>
</FORM>
</body>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble
Ticket application
http://www.houseoffusion.com/banners/view.cfm?bannerid=48
Message: http://www.houseoffusion.com/lists.cfm/link=i:15:759
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/15
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:15
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54