my webpage have two input control that is textbox & search button. i wrote textbox keypress event javascript .
if i try to type keywords in textbox, the keypress event is firing and then click search button control .again i try to type keywords in textbox the keypress event not firing..
Hope u could understand what i meant, plz help me..
this is my code:
if i try to type keywords in textbox, the keypress event is firing and then click search button control .again i try to type keywords in textbox the keypress event not firing..
Hope u could understand what i meant, plz help me..
this is my code:
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
id
=
"Head1"
runat
=
"server"
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
asp:ScriptManager
ID
=
"ScriptManager1"
runat
=
"server"
EnableScriptGlobalization
=
"True"
>
<
Scripts
>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.Core.js"
/>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQuery.js"
/>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQueryInclude.js"
/>
</
Scripts
>
</
asp:ScriptManager
>
<
script
type
=
"text/javascript"
>
window.$ = $telerik.$;
$(document).ready(function() {
var typeDelay = function(){
var timer = 0;
return function(callback, ms){
clearTimeout (timer);
timer = setTimeout(callback, ms);
}
}();
$("#query").keypress(function(){
// your ajax search here, with a 300 ms delay...
typeDelay(function(){
alert('controls comes here.!');
}, 300);
});
});
</
script
>
<
telerik:RadAjaxManager
id
=
"RadAjaxManager1"
runat
=
"server"
DefaultLoadingPanelID
=
"RadAjaxLoadingPanel1"
>
<
ajaxsettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadAjaxPanel1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadAjaxPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
ajaxsettings
>
</
telerik:RadAjaxManager
>
<
telerik:RadAjaxLoadingPanel
id
=
"RadAjaxLoadingPanel1"
Runat
=
"server"
Skin
=
"Default"
Width
=
"100%"
></
telerik:RadAjaxLoadingPanel
>
<
telerik:RadAjaxPanel
ID
=
"RadAjaxPanel1"
runat
=
"server"
Width
=
"100%"
>
<
asp:TextBox
ID
=
"query"
MaxLength
=
"100"
runat
=
"server"
/>
<
asp:Button
ID
=
"btnSubmit"
runat
=
"server"
Text
=
"Search"
/>
</
telerik:RadAjaxPanel
>
</
form
>
</
body
>
</
html
>