MDP
MDP

Reputation: 4267

How to allow user to type date with JQuery DatePicker

I have a JQuery DatePicker in my jsp, and I want to allow user to both use DatePicker and type the date.

I read this API page where I found the constrainInput attribute, and I wrote something like this:

$(function() {
    $( "#datepicker1" ).datepicker();
  });

  $( "#datepicker1" ).datepicker({
      constrainInput: false
    });

But my input text seems to be still in readOnly state

Thank you

Upvotes: 0

Views: 951

Answers (1)

KiwiJuicer
KiwiJuicer

Reputation: 1982

Add the Datepicker only once like this:

$(function() {
    $( "#datepicker1" ).datepicker({
      constrainInput: false
    });
});

Upvotes: 2

Related Questions