1

I need examples for using the wijmo date picker in a text box. I am having trouble in using wijmo date picker. It is working when I am using in div but not in textbox

here is my code:

<%:  Html.TextBox("sample")%>

$(document).ready(function () {
    $("#sample").wijcalendar({ 
        easing: 'easeInQuad' 
    });
});
radbyx
  • 9,352
  • 21
  • 84
  • 127
yogeswaran K
  • 2,278
  • 8
  • 29
  • 45

1 Answers1

2

You still need the div for the calendar itself, but then attach the calendar show option to the input.

<%: Html.TextBox("sample")%>    
<div id="calendar"></div>
$("#calendar").wijcalendar({
    popupMode: true,
    selectedDatesChanged: function () {
        var selDate = $(this).wijcalendar("getSelectedDate");
        if (!!selDate) $("#sample").val(selDate.toDateString());
    }
});

$("#sample").click(function () {
        $("#calendar").wijcalendar("popup", {
            of: $("#sample"),
            offset: '0 2'
        });
    })
});
Banzor
  • 1,122
  • 7
  • 10