Wednesday, May 9, 2012

Set focus on selection of date from jQuery datepicker to control it self

Following is the jQuery code to set focus on control after selecting the date from the jQuery Date Picker

jQuery.extend(jQuery.datepicker, { afterShow: function (event) {
    jQuery.datepicker._getInst('z-index', 99999999);

    $("#divGameQuestionPanel [datepicker]").datepicker({
        changeMonth: true,
        changeYear: true,
        yearRange: 'c-99:c+0',
        showOn: "button",
        buttonImage: calImageSrc,
        buttonImageOnly: true,
        dateFormat: 'dd/mm/yy',
        onSelect: function (dateText, inst) { $(this).focus(); }
    }).focus(function (event) {

Developer must have Browser Addons list

Google Chrom

1) Chrome - use full to select color and its different sades

Live website to use it without add into the browser