Search and Top Navigation
#9374 closed bug (notabug)
Opened June 12, 2013 09:42PM UTC
Closed June 14, 2013 01:53PM UTC
on click event on autocomplete combobox
Reported by: | mcapp32 | Owned by: | mcapp32 |
---|---|---|---|
Priority: | minor | Milestone: | none |
Component: | ui.core | Version: | 1.10.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I have multiple Autocomplete combo boxes on my MVC view.
The first one.. i have and onchange(html shows as onclick when it runs) function to turnOnOverlay(); submit.form(); This basically goes and posts to the controller, and gets data back and populates and sets the values for up to five other autocomplete combo boxes on the form.
Prior to adding the JQuery Autocomplete.. the function worked and posted back and populated the other dropdowns.. After I implemented the AutoComplete. (no _change function) as there are other dropdowns that do not need this form.submit(); It stopped doing the submit.
I do not have a _change function in my js as with the html.dropdown.. i have the ability to have an onchange.
see below:
<div class="ui-widget">
@Html.DropDownList("DKID1", (List<SelectListItem>)ViewBag.DKID, (string)ViewBag.DimensionKey1, new
{
disableValidation = "true",
onchange = @"
turnOnOverlay(); form.submit();"
})
<input type="button" name="btnAddDimensionKey" value="New" onclick="showAddDimensionKey();" />
</div>
Can you think of any reason this won't work? Is there a way for me to in the .js force a submit on change of just the specific Autocomplete combo box?
Any help with this would be greatly appreciated.
Thanks
Mary Cappello
Attachments (0)
Change History (7)
Changed June 13, 2013 01:32PM UTC by comment:1
owner: | → mcapp32 |
---|---|
status: | new → pending |
Changed June 13, 2013 02:05PM UTC by comment:2
_comment0: | Replying to [comment:1 tj.vantoll]: \ Hi. \ \ I do have the event change in my js. \ \ The bug tracking is giving me issues as far as pasting the code in here.. \ \ I have several dropdowns. The first drop down is the one that has the event change code on it. \ \ Is there an email address where I can sent you the html and javascript? \ \ Thanks. \ Mary \ > Hi mcapp32, \ > \ > We'll need a reduced test case free of server side code in order to look into this. But it sounds like you need to use autocomplete's change event: http://api.jqueryui.com/autocomplete/#event-change. \ → 1371134960422516 |
---|---|
status: | pending → new |
Replying to [comment:1 tj.vantoll]:
Hi.
I do have the event change in my js.
The bug tracking is giving me issues as far as pasting the code in here..
I have several dropdowns. The first drop down is the one that has the event change code on it.
http://jsfiddle.net/3Gm2g/1/ what i noticed right off the bat in the jsfiddle.. is that my drop boxes do not show all the css.. they do not appear to be taking the jQuery css. but I think from what I have in there you should be able to look at the JS and the html and see what might be wrong.
or if you have a working example of a dropdown with autocomplete that will do a form.submit on change that would be helpful.
Thanks so much for your help.
Thanks.
Mary
Hi mcapp32, We'll need a reduced test case free of server side code in order to look into this. But it sounds like you need to use autocomplete's change event: http://api.jqueryui.com/autocomplete/#event-change.
Changed June 13, 2013 06:38PM UTC by comment:3
status: | new → pending |
---|
It's very difficult to figure out what's going on in your example. Please reduce your example to the absolute minimum amount of code needed to show the issue you're having.
If you need support try the forums or Stack Overflow.
Changed June 13, 2013 07:19PM UTC by comment:4
_comment0: | Replying to [comment:3 tj.vantoll]: \ \ Good Afternoon: \ \ I did try finding a solution in the forums. \ \ I've trimmed down the code: http://jsfiddle.net/3Gm2g/2/ \ \ Hopefully you'll see something that I'm missing.. Do you have any example of doing a form submit in MVC using on change on a combo box? \ \ Thanks again. \ \ \ > It's very difficult to figure out what's going on in your example. Please reduce your example to the absolute minimum amount of code needed to show the issue you're having. \ > \ > If you need support try the [http://forum.jquery.com/ forums] or Stack Overflow. \ → 1371151537244685 |
---|---|
status: | pending → new |
Replying to [comment:3 tj.vantoll]:
Good Afternoon:
I did try finding a solution in the forums.
I've trimmed down the code: http://jsfiddle.net/3Gm2g/2/
Please note.. what it is supposed to do is a form.submit() on the change of the DKID1 dropdown. The problem is with the jQuery Autocomplete on the dropdown it will not do the form.submit. However, if it does not have the jQuery Autocomplete it will. the problem is the list is so huge normally that they would be scrolling to find what they want ... This really should be simple.. you can see that there is an onchange event. there is in the <select ... onchange="turnOnOverlay(); form.submit();" the overlay just dims the form while it does the submit.. however with the Autocomplete on the dropdown it will not run either command.
Hopefully you'll see something that I'm missing.. Do you have any example of doing a form submit in MVC using on change on a combo box?
Thanks again.
It's very difficult to figure out what's going on in your example. Please reduce your example to the absolute minimum amount of code needed to show the issue you're having. If you need support try the forums or Stack Overflow.
Changed June 13, 2013 09:24PM UTC by comment:5
status: | new → pending |
---|
There's still a lot going on in this example and I get a syntax error.
Changed June 14, 2013 01:11PM UTC by comment:6
status: | pending → new |
---|
Replying to [comment:5 tj.vantoll]:
Basically it's 1 drop down with an onchange event that needs to do a form.submit. after the form submit the other 5 drop downs get updated with a selected item.
With all the stripping out I could see why there might be an error.
Do you have an example of an autocomplete drop down that will do a form submit. I have tried all the possible solutions that I've found on the internet but none of them work.
With all the code on the form and controller, I do not get a syntax error, but It also will not do the submit. If i take the JQuery Autocomplete off the drop down it does the submit.
You guys must have some kind of an example that has code that works and will execute the form.submit() from the onchange event. Could you just give me something like that, that I can implement?
Thanks.
There's still a lot going on in this example and I get a syntax error.
Changed June 14, 2013 01:53PM UTC by comment:7
resolution: | → notabug |
---|---|
status: | new → closed |
You'll want something like this: http://jsfiddle.net/tj_vantoll/2f7th/. This is not the place for support so please take further questions to the forums or Stack Overflow.
Hi mcapp32,
We'll need a reduced test case free of server side code in order to look into this. But it sounds like you need to use autocomplete's change event: http://api.jqueryui.com/autocomplete/#event-change.