jquery-chosen

Required Field Validator not working for JQuery chosen drop down list

北城余情 提交于 2019-12-03 21:49:18
I am using JQuery Choosen for my DropDownList but the required validator for that dropdown is not working . Following is my code .Please guide where i am wrong. Chosen plugin included in the form $(".chosen-select").chosen(); DropDownList code <li> @Html.LabelFor(m => m.DepartmentId) @Html.DropDownListFor(x => x.DepartmentId, (ViewBag.DepartmentsList) as IEnumerable<SelectListItem>, "-- Select an Option --",new { @class = "chosen-select", @style = "width:312px; height:31px;" }) @Html.ValidationMessageFor(m => m.DepartmentId) </li> And Model for the DropDownList [Required(ErrorMessage = "*")]

Update vuejs model value using jquery-chosen plugin

╄→гoц情女王★ 提交于 2019-12-03 13:06:34
Trying to use jquery-chosen with vue, the problem is that this plugin hides the actual select that I applied v-model , so when I select a value vue doesn't recognize it as a select change event and model value is not updated. The value of the select is being changed actually when I select something, I've inspected this with console.log to see the selected value. http://jsfiddle.net/qfy6s9Lj/3/ I could do vm.$data.city = $('.cs-select').val() , that seems to work, But is there another option? If the value of the select was changed why vue doesn't see this? Answer: http://jsfiddle.net/qfy6s9Lj/5

Chosen harvesthq resize width dynamically

China☆狼群 提交于 2019-12-03 12:27:55
问题 How can you have a harvesthq Chosen dropdown with a dynamic width style? By default it has a fixed width and if you try to modify it with CSS you will have several problems to reach a good result. 回答1: This blog recommends the following: $("select").chosen({ width: '100%' }); // width in px, %, em, etc 回答2: this one worked for me, even with multiple select boxes on the screen: $(document).ready(function(){ resizeChosen(); jQuery(window).on('resize', resizeChosen); }); function resizeChosen()

jQuery Chosen plugin without search field

≯℡__Kan透↙ 提交于 2019-12-03 10:37:30
问题 Not sure if this has been covered somewhere, but I couldn't find it in the documentation, and was wondering if it'd be possible to not include the search input box with the jQuery chosen plugin (used to style select inputs). Specifically I'd like to use the standard select one without it. http://harvesthq.github.com/chosen/ 回答1: Well I tried with the documentation as well and no luck, so I finally fixed to this $('.chzn-search').hide(); I do the above after I call chosen. Hope this helps 回答2:

Using chosen.js, how would I add images to the dropdown items?

青春壹個敷衍的年華 提交于 2019-12-03 07:09:29
Using chosen.js, how would I add images to the dropdown items? By setting a background-image on chosen's list items: .chzn-results li { background: url('path/to/img.png') no-repeat 3px center; padding-left: 12px; } Adjust the pixel count accordingly. To complete Joseph (I can't add comment to his answer), the class has changed since an unknown version: Here's the correct css in v1.0.0: li.active-result { background: url('path/to/img.png') no-repeat 3px center; text-indent:2em; } Thx Joseph! 来源: https://stackoverflow.com/questions/12271283/using-chosen-js-how-would-i-add-images-to-the-dropdown

jQuery Chosen: how to select 1 option value and remove the same one in another select-menu?

霸气de小男生 提交于 2019-12-03 06:33:43
I've put 2 elements next to eachother. Both of them are using the jQuery Chosen plugin. This is the code: <div class="wrapper"> <select data-placeholder="Number row 1" style="width:350px;" multiple class="chzn-select"> <option value=""></option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> </select> <select data-placeholder="Number row 2" style="width:350px;" multiple class="chzn-select"> <option value=""></option> <option value="1">1</option> <option value="2">2<

disable jquery-chosen dropdown

大城市里の小女人 提交于 2019-12-03 06:26:20
问题 I have a select div that I'm using the chosen jquery plugin to style and add features to (most notably, search). The div looks something like this, <select data-placeholder="add a foobar" id="foobar" style="width: 350px;"> <option value=""></option> </select> And I'm using the chosen plugin like this, $('#foobar').chosen(); While some AJAX is loading, I'd like to disable the entire <select> div. Maybe with something like this, $('#foobar').disable() or this $('#foobar').prop('disabled', true)

jQuery Chosen plugin without search field

独自空忆成欢 提交于 2019-12-03 01:08:07
Not sure if this has been covered somewhere, but I couldn't find it in the documentation, and was wondering if it'd be possible to not include the search input box with the jQuery chosen plugin (used to style select inputs). Specifically I'd like to use the standard select one without it. http://harvesthq.github.com/chosen/ Well I tried with the documentation as well and no luck, so I finally fixed to this $('.chzn-search').hide(); I do the above after I call chosen. Hope this helps Just a quick follow-up: I noticed that in function AbstractChosen.prototype.set_default_values a variable is

How to implement multiple select in MVC 3 using 'chosen.js' plugin

主宰稳场 提交于 2019-12-03 00:38:31
How to implement chosen plugin for MVC 3 ? for this type of output user3174077 This is my code how to make chosen.js work with javascript/MVC This is my code for my dropdown @Html.DropDownListFor(m => m.CategoryId, new SelectList(Model.Categories, "Id", "Name"), "Choose a Category...", new { id = "CategoryId", multiple = "", @class = "chzn-select srs-select search-dropdown", data_placeholder = "Choose a Category..." }) Here I use 'chzn-select' styling -- In the document ready, one should have the .chosen() function called. $(document).ready(function () { $('.chzn-select').chosen(); }); In

How to set ASP.net dropdownlist index to 0 from the front-end

≡放荡痞女 提交于 2019-12-02 22:46:44
问题 I have the following code in ASP.net page: <asp:DropDownList ClientIDMode="Static" ID="ddl1" CssClass="chosen-select le" runat="server" AppendDataBoundItems="true"></asp:DropDownList> <asp:DropDownList ClientIDMode="Static" ID="ddl2" CssClass="chosen-select le" runat="server" AppendDataBoundItems="true"></asp:DropDownList> <asp:DropDownList ClientIDMode="Static" ID="ddl3" CssClass="chosen-select le" runat="server" AppendDataBoundItems="true"></asp:DropDownList> <input type="button" id=