Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFSET the Display Value in a Select Box

Status
Not open for further replies.

khurram

IS-IT--Management
Jan 10, 2001
95
CA
Does anyone know how to set a variable with the text part of a select box?

For example, <CFSET ShippingOption = FORM.SelectShipping> will set ShippingOption to the value selected. However, I want to set the text displayed.

Any suggestions?
Khurram
 
khurram,
when you submit the form it only sends the select box selected option value, not selected option text.
If you want to get the selected option text value, you need to code like this.

<select name=&quot;SelectShipping&quot;>
<option value=&quot;the value|the text&quot;>the text

and in the next form

<CFSET ShippingOption = #listgetat(SelectShipping, 1, &quot;|&quot;)#>


I used &quot;|&quot; as a delemeter, instead you can use any character
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top