Hi,
I am using a DropDownList as
<asp:DropDownList
ID="ddlLocationName"
runat="server"
DataValueField="Guid"
DataTextField="LocationName"
AppendDataBoundItems="false"
AutoPostBack="false"
onchange="LocationChange()"
></asp:DropDownList>
and when I select item from dropdown the DataTextField should be displayed in the textfield. For that i am using following javascript:
function LocationChange()
{
document.getElementById ("ctl00_mainContent_ctl02_txtEventLocation").value = document.getElementById ('ctl00_mainContent_ctl02_ddlLocationName')[document.getElementById ('ctl00_mainContent_ctl02_ddlLocationName').selectedIndex].value
}
It works fine when dropdown's DataValueField is not used. But how to do desired task when DataValueField property of dropdown is also used?
Thanks in advance.