JQuery datepicker language

Maybe you don’t have a language file: Language files are here: https://github.com/jquery/jquery-ui/tree/master/ui/i18n A new localization should be created in a separate JavaScript file named ui.datepicker-.js. Within a document.ready event it should add a new entry into the $.datepicker.regional array, indexed by the language code, with the following attributes: http://api.jqueryui.com/datepicker/

Restrict date in jquery datepicker based on another datepicker or textbox

For example, in this sample code, startDatePicker is selected as 2010-12-12, change event of startDatePicker sets the minDate of endDatePicker 2010-12-13. It locks the cells before this date. This is a sample for what @Victor mentioned..I hope it helps…Regards…Ozlem. $(“#startDatePicker”).datepicker({ dateFormat: ‘yy-mm-dd’, changeMonth: true, minDate: new Date(), maxDate: ‘+2y’, onSelect: function(date){ var selectedDate = new … Read more

jquery-ui and webpack, how to manage it into module?

jquery-ui-dist and jquery-ui-bundle do not seem to be maintained by the jquery-ui team. After jquery-ui v1.12 Its possible to use the official jquery-ui package from npm with webpack. Update jquery-ui to 1.12 by updating package.json and npm install. Then you can require each widget like this. require(“jquery-ui/ui/widgets/autocomplete”); require(“jquery-ui/ui/widgets/draggable”); If you have used require(“jquery-ui”) before you … Read more

Limit results in jQuery UI Autocomplete

Here is the proper documentation for the jQueryUI widget. There isn’t a built-in parameter for limiting max results, but you can accomplish it easily: $(“#auto”).autocomplete({ source: function(request, response) { var results = $.ui.autocomplete.filter(myarray, request.term); response(results.slice(0, 10)); } }); You can supply a function to the source parameter and then call slice on the filtered array. … Read more

jQuery UI datepicker change event not caught by KnockoutJS

I think that for the jQuery UI datepicker it is preferable to use a custom binding that will read/write with Date objects using the APIs provided by the datepicker. The binding might look like (from my answer here): ko.bindingHandlers.datepicker = { init: function(element, valueAccessor, allBindingsAccessor) { //initialize datepicker with some optional options var options = … Read more

MVC Force jQuery validation on group of elements

You can validate individual controls using Validator.element(element) – see documentation here, so you could use the following approach (you haven’t posted the views html so can’t write the actual code for you) In the Next button click event Select all the the controls within the associated div – e.g. var controls = $(this).closest(‘div’).find(‘input, textarea, select’); … Read more