Ask a Jedi: XML Forms, CFSELECT, and Value Issues

Kevin Smith (I don’t suppose you are the “Clerks” guy?) asked the following question about XML forms and CFSELECT:

I have a simple XML form having a simple cfselect statement like: <cfselect
name = "employeeid"
size = "15" multiple="no">

<option value = "676765">Option 1</option>
<option value = "3333">Option 2</option>
</cfselect>
When you view the generated code or submit the form, the form value is the option text ('Option 1' instead of '676765'). Any Ideas what I am doing wrong?

Turns out there is a bug in XML forms in the current version of ColdFusion MX7. I spoke with Mike Nimer and he confirmed this was fixed in the next release of ColdFusion.

Luckily, Mike also provided a very simple fix. To make the form work now, you need to remove the spaces between the = character and the value. See below:

<option value = "676765">Bad Option</option>

to

<option value="3333">Good Option</option>
Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA https://www.raymondcamden.com

Comments