I need that an atlas update panel refreshes when the text value in a textbox Controls changes.
I have a trigger that works fine when I type text in the textbox. So far so good.
However, the textbox can also be filled by a javascript function that runs on a calendar popup. In this case no event is thrown and my panel isn't updated. So what can I do to handle that change on the text?
am new to ajax and havent done any sort of javascipting prior to this
i TOO have been searching everywhere for a solution to my problem but havent been able to come up with one. i want to reduce the results of a list i print to a page as i type text into a textbox something based on the results printed.
i need to run a function each time the text changes. i tried to do this with OnTextChanged="true" and AutoPostBack="true" in the textbox but this only fires the event when i get out of the textbox.
these controls lie in a user control.
i have this a script as in the user control page:
function FilterDDL()
{
if (Trim(txtAreaCode.Text)) != ""
{
var lb as new listbox
var s int
s = 0
for(s = 0 ; s < lstAreaCode.Items.Count-1 ; s=s+1)
{ if (InStr(lstAreaCode.Items(s).ToString, txtAreaCode.Text) = true)
{lb.Items.Add(ListBox1.Items(s)) ; }
}
lstAreaCode.Items.Clear();
for(s = 0; s <lb.Items.Count - 1;s=s+1)
{ lstAreaCode.Items.Add(lb.Items(s).ToString); }
lb.Dispose();
}
}
i have installed ajax control toolkit and work on vs 2005.
dleffel
Member
20 Points
4 Posts
Re: textbox text change
Feb 25, 2006 05:46 PM|LINK
Pluginbaby
Contributor
2961 Points
486 Posts
MVP
Re: textbox text change
Apr 09, 2006 07:34 AM|LINK
Really really nice one!!
Thanks for the code, and the explanations with it !
Laurent Duveau
MVP / MCT / RD
http://weblogs.asp.net/lduveau/
erickvch
Member
5 Points
1 Post
Re: textbox text change
Jul 21, 2006 10:45 PM|LINK
Hi! I got a similar problem.
I need that an atlas update panel refreshes when the text value in a textbox Controls changes.
I have a trigger that works fine when I type text in the textbox. So far so good.
However, the textbox can also be filled by a javascript function that runs on a calendar popup. In this case no event is thrown and my panel isn't updated. So what can I do to handle that change on the text?
Here is some of the code:
<asp:TextBox ID="TextBoxDate" runat="server" OnTextChanged="TextBoxDate_TextChanged" Width="155" AutoPostBack="true" >
<atlas:UpdatePanel runat="server" ID="pnlSchedule" Mode="Conditional">
<Triggers>
<atlas:ControlValueTrigger ControlID="TextBoxDate" PropertyName="Text" />
<atlas:ControlEventTrigger ControlID="TextBoxDate" EventName="TextChanged" />
</Triggers>
<ContentTemplate>
<asp:Table ID="tabletoUpdate" runat="server">
</asp:Table>
</ContentTemplate>
</atlas:UpdatePanel>
bond_003
Member
2 Points
1 Post
Re: textbox text change
Jul 13, 2009 04:47 PM|LINK
am new to ajax and havent done any sort of javascipting prior to this
i TOO have been searching everywhere for a solution to my problem but havent been able to come up with one. i want to reduce the results of a list i print to a page as i type text into a textbox something based on the results printed.
i need to run a function each time the text changes. i tried to do this with OnTextChanged="true" and AutoPostBack="true" in the textbox but this only fires the event when i get out of the textbox.
these controls lie in a user control.
i have this a script as in the user control page:
function FilterDDL() { if (Trim(txtAreaCode.Text)) != "" { var lb as new listbox var s int s = 0 for(s = 0 ; s < lstAreaCode.Items.Count-1 ; s=s+1) { if (InStr(lstAreaCode.Items(s).ToString, txtAreaCode.Text) = true) {lb.Items.Add(ListBox1.Items(s)) ; } } lstAreaCode.Items.Clear(); for(s = 0; s <lb.Items.Count - 1;s=s+1) { lstAreaCode.Items.Add(lb.Items(s).ToString); } lb.Dispose(); } }i have installed ajax control toolkit and work on vs 2005.