You need to put a 'display' in the code and best practice would be to close
the option tags as you go.
Try this:
<option value="0">0</option>
<option <cfif form.datebirthmm EQ 1>selected</cfif> value="1">Jan
</option>
<option <cfif form.datebirthmm EQ 2>selected</cfif> value="2">Feb
</option>
<option <cfif form.datebirthmm EQ 3>selected</cfif>
value="3">Mar</option>
<option <cfif form.datebirthmm EQ 4>selected</cfif> value="4">Apr
</option>
<option <cfif form.datebirthmm EQ 5>selected</cfif> value="5">May
</option>
<option <cfif form.datebirthmm EQ 6>selected</cfif> value="6">Jun
</option>
<option <cfif form.datebirthmm EQ 7>selected</cfif> value="7">Jul
</option>
<option <cfif form.datebirthmm EQ 8>selected</cfif> value="8">Aug
</option>
<option <cfif form.datebirthmm EQ 9>selected</cfif> value="9">Sep
</option>
<option <cfif form.datebirthmm EQ 10>selected</cfif>
value="10">Oct </option>
<option <cfif form.datebirthmm EQ 11>selected</cfif>
value="11">Nov </option>
<option <cfif form.datebirthmm EQ 12>selected</cfif>
value="12">Dec</option>
----------------------------------
William Seiter
ColdFusion Web Developer / Consultant
http://william.seiter.com
Free Website Trade Publication >> Website Magazine
http://www.websitemagazine.com/referrals/?id=51344&f=text2
Don't forget to answer the survey questions, it's a 10 second task ,
a very small request for access to this incredible resource.
Have you ever read a book that changed your life?
Go to: http://www.winninginthemargins.com
Use PassKey: GoldenGrove
You'll be glad you did.
::-----Original Message-----
::From: L. T. [mailto:[EMAIL PROTECTED]
::Sent: Thursday, June 05, 2008 3:12 PM
::To: CF-Newbie
::Subject: help understanding syntax for webform dropdown
::
::
::Hi,
::
::
::I'm trying to make sense of data in an sql table that resulted from input
::on a webform that had been programmed in coldfusion.
::
::
::an example of coldfusion code is below ... the example is to record the
::month of birth. i understand the user selects values of 1-12 to indicate
::month of birth (jan-dec). What I don't understand is the <option
::value="0"> that appears before the lines for jan-dec. We noticed the
::dropdown appears with a blank space when the page opens and a person
::selects jan-dec below this blankspace. Does the option value="0" mean
::that a value of 0 is written if the dropdown is left blank, nothing is
::selected? Any insights if this is discernible from the code example
::provided would be greatly appreciated!
::
::
:: <td valign="top"><div align="right">* Birthday: </div></td>
:: <td> </td>
:: <td><select name="datebirthmm" style="background-color: ##E6E6E6;
::border: 1 solid ##000000">
:: <option value="0">
:: <option <cfif form.datebirthmm EQ 1>selected</cfif> value="1">Jan
:: <option <cfif form.datebirthmm EQ 2>selected</cfif>
::value="2">Feb
:: <option <cfif form.datebirthmm EQ 3>selected</cfif>
::value="3">Mar
:: <option <cfif form.datebirthmm EQ 4>selected</cfif>
::value="4">Apr
:: <option <cfif form.datebirthmm EQ 5>selected</cfif>
::value="5">May
:: <option <cfif form.datebirthmm EQ 6>selected</cfif>
::value="6">Jun
:: <option <cfif form.datebirthmm EQ 7>selected</cfif>
::value="7">Jul
:: <option <cfif form.datebirthmm EQ 8>selected</cfif>
::value="8">Aug
:: <option <cfif form.datebirthmm EQ 9>selected</cfif>
::value="9">Sep
:: <option <cfif form.datebirthmm EQ 10>selected</cfif>
::value="10">Oct
:: <option <cfif form.datebirthmm EQ 11>selected</cfif>
::value="11">Nov
:: <option <cfif form.datebirthmm EQ 12>selected</cfif>
::value="12">Dec
:: </select>
::
::
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k
Archive:
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:3727
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15