I got it to work like this, if this helps.
<FORM NAME="SwitchTest.cfm" ACTION="SwitchTest.cfm" METHOD="Post">
<SELECT NAME="Track" SIZE="1" MESSAGE="You must make a selection"
REQUIRED="Yes" >
<OPTION VALUE="1">DTS
<OPTION VALUE="2">VTS
</SELECT>
<INPUT TYPE="submit" name="button" value="change now">
</form>
<CFIF IsDefined("Track")>
You have chosen <CFIF Track EQ "1">DTS<CFELSE>VTS</cfif><BR>
Your hours are
<!--- based on that choice --->
<CFSWITCH EXPRESSION="#val(track)#">
<CFCASE VALUE="1">4<BR></CFCASE>
<CFCASE VALUE="2">10<BR></CFCASE>
</CFSWITCH>
</cfif>
-----Original Message-----
From: Richard Kern [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 13, 2000 12:41 PM
To: '[EMAIL PROTECTED]'
Subject: cfselect and variable passing
I thought this was simple but I keep running into a brick wall and my eyes
are getting bruised
I need to pass the result from a select box to other input fields on the
same page and then to a subsequent form.
<SELECT NAME="Track" SIZE="1" MESSAGE="You must make a selection"
REQUIRED="Yes">
<OPTION VALUE="1">DTS
<OPTION VALUE="2">VTS
</SELECT>
<!--- based on that choice --->
<CFSWITCH EXPRESSION="track = "value"">
<CFCASE VALUE="1">
<cfset hours = 4>
</CFCASE>
<CFCASE VALUE="2">
<cfset hours = 10>
</CFCASE>
</CFSWITCH>
Your hours are <output> #hours# </output>
current action page:
the selected value is
<cfif #form.hours# IS "10">
-------------------------------
prolem: not reading the value corresponding to the select choice to the
cfset doesn't execute and no
value is passed to the action page.
Comments would be appreciated - I know I'm missing something obvious, thanks
Richard
----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.