RE: cf select

by "Steve Ball" <sball99(at)mindspring.com>

 Date:  Fri, 4 Aug 2000 14:45:14 -0700
 To:  "Mark Stradling" <mark.stradling(at)blueberry.net>,
<hwg-languages(at)hwg.org>
 In-Reply-To:  netstoremail
  todo: View Thread, Original
Thank you all!  Sometimes I don't see the forest for the trees...duh...

Each who responded provided insight, and together your advice enabled me to
find a very good solution!

This is a great forum...

Regards,
Steve

> -----Original Message-----
> From: owner-hwg-languages(at)hwg.org [mailto:owner-hwg-languages(at)hwg.org]On
> Behalf Of Mark Stradling
> Sent: Friday, August 04, 2000 1:15 AM
> To: Steve Ball; hwg-languages(at)hwg.org
> Subject: RE: cf select
>
>
> Try something along these lines...
>
> <cfquery name="qlocation" datasource="learn_res">
>     SELECT location.location, location.locationid
>     FROM location
>     ORDER BY location
> </cfquery>
>
> <form name="locationform" action="profile_update2.cfm" method="post">
>     <select name="Iselect">
>         <cfoutput query="qlocation">
>             <option value="#locationid#" <cfif location is
> editprofile.location>selected</cfif>>#location#</option>
>         </cfoutput>
>     </select>
> </form>
>
> Now you are creating a form and a single select box, but populating each
> select option for the database query.  For each result in the qlocation
> recordset you check to see if the #location# value is the same as the
> #editprofile.location# variable.  If it is you assign 'selected' to that
> option and it becomes you default.
>
> Is this what you were after?
>
> HTH,
>
> Mark Stradling
> Allaire Spectra Developer
> Blueberry.net
> Creating Fruitful e-Business
>
> > -----Original Message-----
> > From: Steve Ball [mailto:sball99(at)mindspring.com]
> > Sent: 03 August 2000 16:41
> > To: hwg-languages(at)hwg.org
> > Subject: RE: cf select
> >
> >
> > List,
> >
> > I am trying to display a list (of locations) in a select drop-down,
> > "highlighting" (and defaulting to) the location choice which
> > is the result
> > of one unique row of a query.  That data element has been
> > previously chosen
> > from a similar dropdown.  My current solution is to simply display the
> > current value to the user, and provide another select
> > dropdown enabling the
> > user to change the current choice.  Thus I am using two
> > queries.  Somewhat
> > inelegant.  I am doing this in ColdFusion, but the
> > fundamental technology is
> > html select.  Any suggestions?
> >
> > Thanks!
> >
> > Here is the current script as described:
> > **************************************************************
> > **************
> > ************************************************
> > </CFFORM>
> >
> > <!---
> > CHANGE YOUR LOCATION FORM --->
> >
> >     <tr>
> >     <TD colspan=2> Your Location:  #editprofile.location#<br><br>
> > 	If you wish to change your location, please choose from
> > the list below, and
> > click "Submit" to update your information.</TD>
> >  </tr>
> >   <tr>
> > <td colspan=2>
> > <cfform name=locationform action="profile_update2.cfm">
> > <cfquery name="qlocation" datasource="learn_res">
> > SELECT location.location, location.locationid
> > FROM location
> > ORDER BY location
> > </cfquery>
> >
> > <CFSELECT NAME="lselect"
> > size=5
> > query="qlocation"
> > value="locationid"
> > display="location"
> > required="yes"
> > message="Please select your location and press Submit to continue">
> > <option>#location#
> > </CFSELECT>
> >
> > </td>
> > </tr>
> >
> > <tr><td colspan=2><script
> > src="../js/simple-submit.js"></script></td></td></tr>
> > <tr><td colspan=2><hr></td></tr>
> > </CFFORM>
> > </table>
> >
> > **************************************************************
> > **************
> > **********************************************
> > Note that the data element "editprofile.location" is based on a select
> > query, "editprofile", returning a unique row with value for
> > location, while
> > the select list is based on a separate query, "qlocation".
> > I'm trying to
> > figure out some way to pass the editprofile.location value to
> > the select
> > function to id the current value.
> > **************************************************************
> > **************
> > **********************************************
> >
> > > -----Original Message-----
> > > From: Peter Benoit [mailto:pbenoit(at)triton-network.com]
> > > Sent: Tuesday, August 01, 2000 8:35 AM
> > > To: 'Steve Ball'
> > > Subject: RE: cf select
> > >
> > >
> > > Ok, I read it 3 times and still dunno what yer trying to
> > do.  You have the
> > > cf example somewhere?
> > >
> > > -----Original Message-----
> > > From: Steve Ball [mailto:sball99(at)mindspring.com]
> > > Sent: Sunday, July 30, 2000 2:16 PM
> > > To: hwg-languages(at)hwg.org
> > > Subject: cf select
> > >
> > >
> > > Hi list,
> > >
> > > Anyone know how to set up a query based dynamic select to
> > > initially focus on
> > > one row, but allowing the user to update to another?  The
> > specific script
> > > language targeted is ColdFusion (CFSelect), but if there is a
> > > generic (html)
> > > solution I can adapt.  All I've been able to do is display
> > the existing
> > > value in a form and allow an update from a select list
> > based on another
> > > query.  Not very elegant...
> > >
> > > tia
> > > Steve Ball
> > >
> > >
> >
>

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA