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:

<FONT COLOR=NAVY><FONT COLOR=FF8000><option value=<FONT COLOR=BLUE>""</FONT> <FONT COLOR=MAROON><cfif form.donationForm is <FONT COLOR=BLUE>""</FONT>></FONT></FONT></FONT>selected<FONT COLOR=MAROON></cfif></FONT>>All<FONT COLOR=NAVY><FONT COLOR=FF8000></option></FONT></FONT>

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

<FONT COLOR=MAROON><cfdump var=<FONT COLOR=BLUE>"#form#"</FONT>></FONT>

<FONT COLOR=MAROON><cfform format=<FONT COLOR=BLUE>"flash"</FONT>></FONT>
   <FONT COLOR=MAROON><cfselect name=<FONT COLOR=BLUE>"foo"</FONT>></FONT>
      <FONT COLOR=NAVY><FONT COLOR=FF8000><option value=<FONT COLOR=BLUE>""</FONT>></FONT></FONT>Blank<FONT COLOR=NAVY><FONT COLOR=FF8000></option></FONT></FONT>
      <FONT COLOR=NAVY><FONT COLOR=FF8000><option value=<FONT COLOR=BLUE>"1"</FONT>></FONT></FONT>One<FONT COLOR=NAVY><FONT COLOR=FF8000></option></FONT></FONT>
   <FONT COLOR=MAROON></cfselect></FONT>
<FONT COLOR=MAROON><cfinput type=<FONT COLOR=BLUE>"submit"</FONT> name=<FONT COLOR=BLUE>"f1"</FONT> value=<FONT COLOR=BLUE>"submit"</FONT>></FONT>
<FONT COLOR=MAROON></cfform></FONT>

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