How do I not submit a form using AJAXToolkit autocomplete?

I have used the AJAXToolkit autocomplete extender in my project. He works fine. But the problem is with the form of the page. when I type AutoComplete I get a list of suggestions. When I click on a page other than autocomplete, the form is submitted. Any suggestions on how to stop submitting the entire form whenever I click on the page? I am using .net 2.0

0


source to share


4 answers


Does your TextBox have AutoPostBack = "True"? If so, it will automatically return when you're β€œdone” (when the input control loses focus). If so, set it to false.



+2


source


Yes, My TextBox AutoPostBack was set to true, which I have now changed to false.

but I have a url attached to each of my suggestions. When the user clicks on a suggestion, the user is taken to that specific URL. When I do AutoPostback = "false", I will not navigate this page.



HOw am I handling it?

0


source


I think it would be as simple as adding the required validator to your element to see if it has selected anything.

Eric

0


source


Use jquery to add an event handler that detects clicks. When a click occurs, stop the browser. Let me know if you need the code.

0


source







All Articles