Let me try that again, only this time I wont press the "enter" key
prematurely!

You can do this very easily with the cfselects, but in this case i want all
the options visible at once to the users.  SO i have to use either radio
buttons or checkboxes.  Since one and only one option can be chosen, radio
buttons is the thechnique to use.

In your case, the cfselects is wonderful.    Here's an example, where the
current value is taken from the query "getuser": and the list of countries
is taken from a query on a "countries" table called "getcountries":

<cfselect name="country"
         label="What country are you from?"
         query="getcountries"
        display="countryname"
        value="countrycode"
        selected="#getuser.country#" />

It automatically selects the option where the value matches the one in the
"getcountries" query.

Gone are all the option tags, all the cfif statements,  etc.    This is what
tells me there's probably a way to do something similar with radio buttons
and checkboxes.

Sadly, putting a CFIF inside a CFINPUT tag is a nono.   Generates an error,
so your technique wont work.  That's how you do it using the old <form>tags,
but in the CFFORM environment it wont work.


Cheers
Mike Kear
Windsor, NSW, Australia
Certified Advanced ColdFusion Developer
AFP Webworks
http://afpwebworks.com
ColdFusion, PHP, ASP, ASP.NET <http://asp.net/> hosting from AUD$15/month




>  On 3/19/06, Will Tomlinson <[EMAIL PROTECTED]> wrote:
> >
> > Mike,
> >
> > I'm doing the same thing except I used a select menu to make things
> > easier on myself. I have a tblpaymentOptions I can query. Then use that
> > query in the select query attribute.
> >
> > I run my cfif's up above the form and set a variable called
> > payoptionchecked or some such name. It'd = yes or no.
> >
> > Then in the selected attribute of the select menu, I put that variable.
> >
> > In your case, with an input, could you setup a list of options?
> >
> > <cfset payOptionList = "Visa, M/C, AMEX">
> >
> > Then loop over the list, checking the values against your shopper data?
> >
> > <cfloop list="#payOptionList#" index="thisoption">
> >
> > <cfoutput>
> > <input type="radio" name="PaymentMethod" value="#thisoption#"
> > Label="#thisoption#"<cfif thisoption EQ "#order.getpaymentmethod()#">
> > checked="true"</cfif>>
> > </cfoutput>
> >
> >
> > Did this off the top of my head real quick, so sorry if it doesn't work.
> > lol!
> >
> > Will
> >
> >


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:235726
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to