Jeff,
Try:
<cfinput type="Radio" name="live" value="yes" <cfif live is
"NO">checked</cfif>>Yes
<cfinput type="Radio" name="live" value="no" <cfif live is
"YES">checked</cfif>>No
You want to set the value attribute explicitly because that is the value
passed in the name/value pair when the user submits. You only need to check
the state of live to set the initial value displayed to the user.
Douglas Malcolm
-----Original Message-----
From: Jeff Fongemie [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 27, 2001 9:26 PM
To: CF-Talk
Subject: dynamic radio buttons?
Hello cf-talk,
OK. I'm using a table for content management called news (db is
oracle). In that news table is a field called live that needs to be
either YES or NO.
When a user fills out addnews.cfm the form passes the field live as
hidden and a value of NO.
So, I'm creating a form that will allow a user to edit the news
record. The live field is important and I'd like radio buttons that
will dynamicly populate with the value of the live field,
corresponding to the passed url ID.
I'm having trouble with the radio buttons.
I'm trying:
<cfquery NAME="news" datasource="#application.DSN#" >
SELECT newsID, headline, news, live
FROM news
WHERE NEWSID =#newsID#
</cfquery>
<cfform action="newseditaction.cfm" METHOD="POST">
<input type="hidden" NAME="newsID" VALUE="#newsID#">
<p>
Date Entered: #date_entered#<br>
Headline: <cfinput type="Text" name="headline"
value="#trim(headline)#" message="Please enter a headline"
required="Yes" size="50" maxlength="150"><br>
News: <cfinput type="Text" name="news" value="#trim(news)#"
message="Please enter the news" required="Yes" size="50"
maxlength="150"><br>
Live:
<cfinput type="Radio" name="live" value="#trim(live)#"<cfif live is
"NO">checked="No"</cfif>>
<cfinput type="Radio" name="live" value="#trim(live)#" <cfif live is
"YES">checked="Yes"</cfif>>
<INPUT TYPE="submit" VALUE="update this news">
</cfform>
I get the following error:
Just in time compilation error
Invalid token found on line 40 at position 55. ColdFusion was looking at the
following text:
<
Invalid expression element. The usual cause of this error is a misspelling
in the expression text.
Can radio buttons be used to update? What am I doing wrong?
thanks for any help!
Best regards,
Jeff Fongemie mailto:[EMAIL PROTECTED]
------------------------
Internet Guns For Hire
(603) 356-0768
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists