You already have everything you need in there:
<CFIF #pagetopic_count# is 1><INPUT type="submit"
name="button" value="Edit Specs"></cfif>
Or <INPUT type="submit" name="button" value="Edit Specs" <CFIF
#pagetopic_count# is 0>disabled</cfif>>
Will do the trick for you.
-----Original Message-----
From: Scot VanAlstine [mailto:[EMAIL PROTECTED]
Sent: 17 March 2005 14:19
To: CF-Newbie
Subject: stopping an empty submit[Scanned]
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>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49
Message: http://www.houseoffusion.com/lists.cfm/link=i:15:757
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