i 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. so 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.
I have been trying to get to grips with the atlas beta and have used the AutoCompleteExtender but it wont work for my purposes because i need access to a radio list control which i cant pass into a WebService Function.
You should handle the onkeypress client-side event of the textbox. That should be all you need. In that client-side event handler, get the current textbox.value and do an AJAX callback to your server-side method for results, then update your radio list
according to what's returned.
are you using an auto-complete TextBox or a simple TextBox to do this? I don't understand if you want to update the list each time a character is typed into the TextBox or when an item is chosen from the completion list.
I wanna call a server side method from a javascript funtion, would you pls help me that.
When i call the following code from aspx file , i gets error TestSearch undefined whereas TestSearch.doSearch() is defined in codebehind, Make sure its not a webserivce call.
I would really appreciate you.
Note: I have script library and atlas.dll in the project.
Thanks!
<script type="text/javascript" >
function callSearch() { this is called from a button.
I'm curious, is there a way to use the onKeyPress method where it wouldn't fire immediately, say wait 300 miliseconds to see if there are further changes. I don't want it to fire in the midst of typing a word, only when the user is done or has paused.
I'm basically trying to accomplish what "onChange" accomplishes without having to leave the control.
I'm curious, is there a way to use the onKeyPress method where it wouldn't fire immediately, say wait 300 miliseconds to see if there are further changes.
nice suggestion. I've coded an Atlas behavior based on your requirement. You'll find the code
here.
rupurt
Member
145 Points
38 Posts
textbox text change
Feb 13, 2006 11:29 AM|LINK
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. so 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.
I have been trying to get to grips with the atlas beta and have used the AutoCompleteExtender but it wont work for my purposes because i need access to a radio list control which i cant pass into a WebService Function.
jarrednichol...
Member
117 Points
25 Posts
Re: textbox text change
Feb 13, 2006 07:02 PM|LINK
You should handle the onkeypress client-side event of the textbox. That should be all you need. In that client-side event handler, get the current textbox.value and do an AJAX callback to your server-side method for results, then update your radio list according to what's returned.
Hope that helps.
Best regards,
Jarred
http://www.jarrednicholls.com/
rupurt
Member
145 Points
38 Posts
Re: textbox text change
Feb 15, 2006 12:40 PM|LINK
jarrednichol...
Member
117 Points
25 Posts
Re: textbox text change
Feb 15, 2006 04:06 PM|LINK
Don't use the "Atlas API". Just use standard JavaScript, and add a handler for onkeypress to the input, as such:
<input type="text" id="myTextBox" onkeypress="myJavaScriptHandlerFunction();" />
And you're done. Inside that handler function, pass the textbox.value to an AJAX/Atlas callback function to get server results.
Understand?
Jarred
http://www.jarrednicholls.com/
Garbin
Contributor
7428 Points
1507 Posts
ASPInsiders
Re: textbox text change
Feb 15, 2006 05:07 PM|LINK
Hi,
are you using an auto-complete TextBox or a simple TextBox to do this? I don't understand if you want to update the list each time a character is typed into the TextBox or when an item is chosen from the completion list.
jarrednichol...
Member
117 Points
25 Posts
Re: textbox text change
Feb 15, 2006 05:20 PM|LINK
I am confident he wants the former, w/ each character typed. My solution is the way to accomplish this.
Jarred
http://www.jarrednicholls.com/
rupurt
Member
145 Points
38 Posts
Re: textbox text change
Feb 15, 2006 06:22 PM|LINK
thanks for your help people. the onkeypressed is exactly what i needed
leoguy
Member
122 Points
59 Posts
Re: textbox text change
Feb 23, 2006 09:13 PM|LINK
Jarred,
I wanna call a server side method from a javascript funtion, would you pls help me that.
When i call the following code from aspx file , i gets error TestSearch undefined whereas TestSearch.doSearch() is defined in codebehind, Make sure its not a webserivce call.
I would really appreciate you.
Note: I have script library and atlas.dll in the project.
Thanks!
<script type="text/javascript" >
function callSearch() { this is called from a button.
TestSearch.doSearch(OnComplete,OnTimeOut);
}
function OnComplete(result) {
alert(result);
}
function OnTimeOut() {
alert("Timed Out");
}
</script>
dleffel
Member
20 Points
4 Posts
Re: textbox text change
Feb 24, 2006 05:43 PM|LINK
I'm basically trying to accomplish what "onChange" accomplishes without having to leave the control.
Garbin
Contributor
7428 Points
1507 Posts
ASPInsiders
Re: textbox text change
Feb 25, 2006 09:40 AM|LINK
nice suggestion. I've coded an Atlas behavior based on your requirement. You'll find the code here.