views:

16

answers:

1

If I insert new INPUT with new ID, how do I enable that new INPUT to have the calendar popup with jsDatePick?

http://javascriptcalendar.org/javascript-date-picker.php

Anyone tried?

A: 

First create the input dynamically and append it somewhere (in the example I append it to the body). Afterwards, set it as a JsDatePick object like in the examples on their site but the "target" parameter should be the ID of the input

var inputId = 'myNewInput';
$('<input />').attr('id',inputId).appendTo(body);
new JsDatePick({
            useMode: 2,
            target: inputId,
            dateFormat: "%d-%M-%Y"
        });
IgalSt