I would probably put the submit button code within a <CFIF> tag.
Something along the lines of:
<CFIF #Pagetopic.Recordcount#>
<TD align="right"><INPUT type="submit" name="button" value="Edit
Specs">
</TD>
</CFIF>
If pagetopic returns results, <CFIF> will evaluate that to a Boolean
True and process the code within, displaying the submit button.
Matt Osbun
Web Developer
Health Systems, International
-----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>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how to get a fax number that sends and receives faxes using your
current email address
http://www.houseoffusion.com/banners/view.cfm?bannerid=64
Message: http://www.houseoffusion.com/lists.cfm/link=i:15:758
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