deepss
deepss

Reputation:

How to Not Submit a Form Using AJAXToolkit AutoComplete Extender?

I have used AJAXToolkit AutoComplete extender in my project.It works fines.But the issue is with the form of the page. when i type in the AutoComplete, i get list of suggestions.When i click on the page other than the Autocomplete, the form gets submitted. any suggestions how to stop submission of entire form whenever i click on the page?I use .net 2.0

Upvotes: 0

Views: 1073

Answers (4)

craigmoliver
craigmoliver

Reputation: 6562

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

Upvotes: 0

epascarello
epascarello

Reputation: 207527

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

Eric

Upvotes: 0

deepss
deepss

Reputation:

yeah,My TextBox AutoPostBack was set to true which i have changed it to false, now.

but i have a url attached to each of my suggestions.On click of suggestion, user gets navigated to that particular url. When i do AutoPostback= "false", i wont get navigated to that page.

HOw do i handle it?

Upvotes: 0

calebbell
calebbell

Reputation:

Does your TextBox have AutoPostBack="True" set? If so, it will automatically postback when you're "finished" (when the input control loses focus). If this is the case, just set it to false.

Upvotes: 2

Related Questions