views:

446

answers:

3

I want to use a autocomplete combobox http://jqueryui.com/demos/autocomplete/#combobox within a modal dialog. However whenever I click on the down arrow (of the combobox) it causes a refresh that results in my modal window closing.

How do I stop the refresh from occuring? (I am still new to jQuery)

I am using UI 1.8 and jQuery 1.4.1.

A: 

Ok I fixed my own problem by removing the form tag from around the combobox

Daveo
A: 

Thanks for posting - that was a huge help. I had the same problem.

David
+1  A: 

The problem is discussed on the jQuery forum here: http://forum.jquery.com/topic/autocomplete-combobox-problem-when-it-is-placed-inside-a-form-tag

They suggest several different ways of adjusting the source code of the autocomplete combo to fix it. The simplest one seems to be this:

Change the line that says

$("<button>&nbsp;</button>") 

to

$("<button type=\"button\">&nbsp;</button>")

this prevents the type="submit" from being inserted into the final button.

codeulike