Issue with empty strings and Flash Forms

So I noticed something odd today. I have a selectbox in a Flash Form that has a top level option doing this:

<option value="" <cfif form.donationForm is "">selected</cfif>>All</option>

However, when I submit the form, the value is “”, not an empty string. Here is a more full featured example that shows it:

<cfdump var="#form#">

<cfform format="flash">
   <cfselect name="foo">
      <option value="">Blank</option>
      <option value="1">One</option>
   </cfselect>
<cfinput type="submit" name="f1" value="submit">
</cfform>

If you change the format to HTML, it works as expected.

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