jQuery UI Widgets › Forums › Lists › DropDownList › DDlist Reset problem.
Tagged: clearselection, DropDownList, Input, jqxDropDownList, reset, selectedIndex, value
This topic contains 4 replies, has 2 voices, and was last updated by darkelf 10 years, 2 months ago.
-
AuthorDDlist Reset problem. Posts
-
Hi;
I use dropdownlist. Bu i have a problem. I have two ddlist in my form. 1) Person, 2) Firm.
User can select one of them. Sometime user change firm value and select to person. I set to none other value.$(‘#inputHKurulus’).on(‘select’, function (event) {
$(‘#inputHKisi’).jqxDropDownList({selectedIndex: -1}); // Reset to Person
});$(‘#inputHKisi’).on(‘select’, function (event) {
$(‘#inputHKurulus’).jqxDropDownList({selectedIndex: -1}); // Reset to Firm
}
This work. But Firm or Person value is not reset. I saw to debuggin : <input type=”hidden” value=”xxxx”/>
This value is not set to null or -1 or whatever. Keep last value.I try to this.
$(‘#inputHKurulus’).on(‘select’, function (event) {
$(‘#inputHKisi’).jqxDropDownList({selectedIndex: -1});
$(‘#inputHKisi input’).val(“”);
});$(‘#inputHKisi’).on(‘select’, function (event) {
$(‘#inputHKurulus’).jqxDropDownList({selectedIndex: -1});
$(‘#inputHKurulus input’).val(“”);
});
After this value is blank like i want. But is not change after select any value.Can you help me to fix this? Thanks.
Hello darkelf,
What you are trying to achieve is not something that is supported by jqxDropDownList. If you could share what would you like to achieve by doing this, we may be able to provide you with a solution using jqxDropDownList’s supported API.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi;
I think i want to simple. I want to unselect value programmatically. I use this code:$(‘#inputHKurulus’).jqxDropDownList({selectedIndex: -1}); // Unselect to value.
DDListbox’s text changed to “Please Select” but value is not changed. It’s contains to last value. When i post the form i saw this…
(When I’m inspect the page, i saw <input type=”hidden” value=”xxxx”/> xxx is last value of DDListbox. But DDListbox’s text is “Please Select” at this moment.)Hi darkelf,
Instead of setting selectedIndex to -1 you can try calling the method clearSelection.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/It’s work perfect.
Thanks. -
AuthorPosts
You must be logged in to reply to this topic.