//Use this. I implemented this in my current assignment and it worked perfectly for me.
var input12 = new TextInput({
"id": "input12",
"value": "$form.StartDate$",
"default": "$StartDate$",
"el": $('#input12')
}, {tokens: true}).render();
$("input[id^='input12']").datepicker();
input12.on("change", function(newValue) {
FormUtils.handleValueChange(input12);
});
//when the back end Code is generated,Splunk adds up some extra digits at the end of the input12, this piece of code
$("input[id^='input12']") ensures that it ignores what ever is at the end of input12 and calls the date picker function for that input.
... View more