MorganGreylock
Programmer
Hello,
I'm trying to make a 'member info update page' where people can update their bio information. Mostly it works fine, although I'm running into a difficult due to the fact that my original signup form had a dropdown list for states... it looked like the following:
<select name="state">
<cfinclude template="template_state_select.cfm">
</select>
Where template_state_select.cfm contained the following:
<option value="0">--Select State--
<option value="AL">Alabama
<option value="AK">Alaska
<option value="AZ">Arizona
<option value="AR">Arkansas
<option value="CA">California
......
That way, I didn't have to type in that code (used many times on this site) over and over again, and it worked perfectly.
Now the problem rises when I want them to update their information. I have dynamically populated text boxes with
their name, address, etc, but I want the state field to remain a dropdown list, but be populated with the state that they chose. Note that I recorded the 2-letter abbrevation. I have that value, and *could* put that value back into a text box, but I think that would look cheesy and want to keep the dropdown list. Short of doing a <if state=ak then state = Alaska, if state=ca then state=california, etc etc., anyone have any idea how I can do this?
I've already solved half the problem, and heres what I've come up with... I think it will work:
<select name="state">
<cfinclude template="template_state_select.cfm">
<option value=#state# SELECTED>XXXXXXXX
</select>
I have the value from #state#, but I dont know how to get the full State name to replace the XXXXXXXX... Any suggestions?
I think that since the only data I have is the two letter abbreviation, that I'm stuck with a huge CFSWITCH statement, but you never know... thought maybe CF might have some dandy little state-lookup feature or something.![[smile] [smile] [smile]](/data/assets/smilies/smile.gif)
Thanks in advance.
Morgan
I'm trying to make a 'member info update page' where people can update their bio information. Mostly it works fine, although I'm running into a difficult due to the fact that my original signup form had a dropdown list for states... it looked like the following:
<select name="state">
<cfinclude template="template_state_select.cfm">
</select>
Where template_state_select.cfm contained the following:
<option value="0">--Select State--
<option value="AL">Alabama
<option value="AK">Alaska
<option value="AZ">Arizona
<option value="AR">Arkansas
<option value="CA">California
......
That way, I didn't have to type in that code (used many times on this site) over and over again, and it worked perfectly.
Now the problem rises when I want them to update their information. I have dynamically populated text boxes with
their name, address, etc, but I want the state field to remain a dropdown list, but be populated with the state that they chose. Note that I recorded the 2-letter abbrevation. I have that value, and *could* put that value back into a text box, but I think that would look cheesy and want to keep the dropdown list. Short of doing a <if state=ak then state = Alaska, if state=ca then state=california, etc etc., anyone have any idea how I can do this?
I've already solved half the problem, and heres what I've come up with... I think it will work:
<select name="state">
<cfinclude template="template_state_select.cfm">
<option value=#state# SELECTED>XXXXXXXX
</select>
I have the value from #state#, but I dont know how to get the full State name to replace the XXXXXXXX... Any suggestions?
I think that since the only data I have is the two letter abbreviation, that I'm stuck with a huge CFSWITCH statement, but you never know... thought maybe CF might have some dandy little state-lookup feature or something.
![[smile] [smile] [smile]](/data/assets/smilies/smile.gif)
Thanks in advance.
Morgan