> Sorry, this is probably very simple but I can't figure it out. I have a
> pre-selected value on my select box but it won't display. It should
> pre-select Maryland but it goes to the first option, Alaska. If I
hard-code
> "MD" into the 'SELECTED' parameter of the CFSELECT tag, the right option
is
> selected but if it is drawn from the query, it is wrong. Can anyone tell
me
> why?
The only reason that Alaska is selected by default is because none of your
OPTION tags (generated by the CFSELECT) contain the SELECTED attribute.
This normally indicates that none of the values from the query matched the
value you specified as SELECTED.
The best guess I can make from looking at the output of your code is that
the value stored in the DB is "MD " (note the trailing spaces). This
could prevent the CFSELECT from pre-selecting Maryland because "MD" is not
the same as "MD ". Take a close look at the data in your
database... my guess is your problem lies there.
You could try changing the SELECTED parameter of the CFSELECT to read
SELECTED="#Trim(GetCompanyAddress.State)#"
but the best solution really is to fix up the data in the database.
Regards,
Seth Petry-Johnson
Argo Enterprise and Associates
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.