Member_2_1242703
asked on
Making a selection from an AJAX dropdown extender appear in a textbox inside a repeater in ASP.NET / Javascript
I'm trying to make an AJAX dropdownextender selection (from a list box) that is inside a repeater control, populate the relative text box when a selection is made.
How do I do this?
TIA
<asp:TextBox ID="tbSeparator" Text=<%#Eval("Separator")%> runat="server" Wrap="False" Width="176" Font-Names="Verdana" ForeColor="#666666"></asp:TextBox>
<cc1:DropDownExtender ID="ddeSeparator" DropDownControlID="lbSeparator"
runat="server" DynamicServicePath="" Enabled="True" TargetControlID="tbSeparator"
HighlightBackColor="WhiteSmoke">
</cc1:DropDownExtender>
<asp:ListBox ID="lbSeparator" runat="server"
CssClass="alwaysontop" OnTextChanged="UpdateSeparator" Height="85px">
</asp:ListBox>
How do I do this?
TIA
ASKER
Thanks. I'm able to utilize the dropdown extender, no problem. It's when it's inside a repeater is when I'm running into problems. Also, your links show how to make this happen in the code behind. Per my title, I'm trying to do this on the client side. Thanks again.
can you share your javascript code here?
ASKER
<script type="text/javascript">
function closest(ele, className) {
do {
ele = ele.parentNode;
if (ele.className !== undefined && ele.className.indexOf(className) > -1) {
return ele;
}
} while (ele.className !== undefined);
return null;
}
window.popit = function popit(ele) {
var de = closest(ele.parentElement, 'entrye');
de.getElementById("tbSeparator").innerHTML = this.options[this.selectedIndex].text;
}
</script>
This is one of may variations I've been trying
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
glad to know you got the solution,
sorry for the delay, couldn't get back to you.
sorry for the delay, couldn't get back to you.
ASKER
Figured it out
AJAX Control Toolkit Dropdown Extender Tutorial ASP.NET C#
here's another one
How to use DropDownExtender in asp.net ajax
hope this helps.