Add calendar datepicker with Jquery on dynamic table.

Posted by Cesar Lopez on Stack Overflow See other posts from Stack Overflow or by Cesar Lopez
Published on 2010-04-13T08:27:50Z Indexed on 2010/04/13 8:32 UTC
Read the original article Hit count: 504

Filed under:
|
|

I am trying to add a Jquery calendar picker to a text box at the time of creation, but I cant find how.

When I press a button, it will create a table, the element I want to attach the Jquery calendar picker is:

  var txtDate = createTextInput(i, "txtDate", 8, 10);
  txtDate.className  = "datepicker";
  this.newcells[i].appendChild(txtsDate);

I tried adding at the end :

  txtDate.datepicker();

But does not work. Can anybody help?

Thanks.

© Stack Overflow or respective owner

Add calendar datepicker with Jquery on dynamic table.

Posted by Cesar Lopez on Stack Overflow See other posts from Stack Overflow or by Cesar Lopez
Published on 2010-04-13T09:52:35Z Indexed on 2010/04/13 11:23 UTC
Read the original article Hit count: 504

Filed under:

I am trying to add a Jquery calendar picker to a text box at the time of creation, but I cant find how.

When I press a button, it will create a table, the element I want to attach the Jquery calendar picker is:

var txtDate = createTextInput(i, "txtDate", 8, 10);
txtDate.className  = "datepicker";
this.newcells[i].appendChild(txtDate);

I tried adding at the end :

txtDate.datepicker();

But does not work. Can anybody help?

Thanks.

Note: CreateTextInput is:

function createTextInput(i, strName, size, maxLength) {
    var input = document.createElement('<input>');
    input.type = "text";
    input.name = strName;
    input.id = strName + i;
    input.size = size;
    input.maxLength = maxLength;

    return input;
}

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about datepicker