lulu50
asked on
populate textbox
Hi,
I want to populate my txtArea with list of states pulled from my database.
If I am using a dropdown box I would use option but for the txtarea how can I identify the value and the name of the textarea.
my code is wrong textarea shouldn't have option??
<textarea id="TxtAreaState" name="TxtAreaState" cols="20" rows="8">
<cfoutput query="DispState">
<option value="#DispState.StateID# ">#DispSta te.StateNa me#</optio n>
</cfoutput>
</textarea>
I want to populate my txtArea with list of states pulled from my database.
If I am using a dropdown box I would use option but for the txtarea how can I identify the value and the name of the textarea.
my code is wrong textarea shouldn't have option??
<textarea id="TxtAreaState" name="TxtAreaState" cols="20" rows="8">
<cfoutput query="DispState">
<option value="#DispState.StateID#
</cfoutput>
</textarea>
<CFQUERY DATASOURCE="xx" NAME="DispState" cachedwithin="#createTimeSpan(0,0,0,-1)#">
SELECT distinct StateTbl.StateID, StateTbl.StateName
FROM StateTbl
LEFT JOIN CityTbl ON CityTbl.StateID = StateTbl.StateID
LEFT JOIN ChurchTbl ON ChurchTbl.ChCityID = CityTbl.CityID
WHERE ChurchTbl.ChurchName <> "null" and ChurchTbl.ChurchStatus = 1
and CityTbl.CityStatus = 1 and StateTbl.StateStatus = 1
</CFQUERY>
why do you nee d drop down? is that just an otput. what are you trying to do ?
ASKER
<textarea id="TxtAreaState" name="TxtAreaState" cols="20" rows="8">
<cfoutput query="DispState">
#DispState.StateName# [#DispState.StateID#]<br>
</cfoutput>
</textarea>
I don't want to show the id
http://www.churchesbulletin.com/
when the user click on the state I have to populate the city
<cfoutput query="DispState">
#DispState.StateName# [#DispState.StateID#]<br>
</cfoutput>
</textarea>
I don't want to show the id
http://www.churchesbulletin.com/
when the user click on the state I have to populate the city
then do this
<textarea id="TxtAreaState" name="TxtAreaState" cols="20" rows="8">
<cfoutput query="DispState">
#DispState.StateName#<br>
</cfoutput>
</textarea>
But in order to do this I would recommend using this plugin
http://codeassembly.com/Simple-chained-combobox-plugin-for-jQuery/
<textarea id="TxtAreaState" name="TxtAreaState" cols="20" rows="8">
<cfoutput query="DispState">
#DispState.StateName#<br>
</cfoutput>
</textarea>
But in order to do this I would recommend using this plugin
http://codeassembly.com/Simple-chained-combobox-plugin-for-jQuery/
ASKER
I am not sure why there is empty spaces
try this
<textarea id="TxtAreaState" name="TxtAreaState" cols="20" rows="8">
<cfoutput query="DispState">
#trim(DispState.StateName) #
</cfoutput>
</textarea>
<textarea id="TxtAreaState" name="TxtAreaState" cols="20" rows="8">
<cfoutput query="DispState">
#trim(DispState.StateName)
</cfoutput>
</textarea>
ASKER
erikTsomik
I don't have the <br> and I still have spaces
I don't have the <br> and I still have spaces
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you
thank you
<textarea id="TxtAreaState" name="TxtAreaState" cols="20" rows="8">
<cfoutput query="DispState">
#DispState.StateName# [#DispState.StateID#]<br>
</cfoutput>
</textarea>