RE: cf select

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

 Date:  Thu, 3 Aug 2000 08:41:27 -0700
 To:  <hwg-languages(at)hwg.org>
 In-Reply-To: 
  todo: View Thread, Original
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