Reputation: 137
I need to use jQuery datepicker by popup window to select date and fill in text field in diffrent window.(datepicker and textfield they are in diffrent window)
I directly add some code for clear button in jquery-ui-1.8.16.custom.min.js in DIV of buttonpanel in datepicker
<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+
B+".datepicker._clearDate(this);\">Clear</button>
and my popup window code like this.
$("#datepicker").datepicker({
showButtonPanel: true,
changeMonth: true,
changeYear: true,
onSelect: function(dateText, inst)
{
var doc = window.opener.form;
doc.textfieldname.value = dateText;
window.close();
}
});
});
<div id="datepicker" align="center"></div>
How can I make clear button work by clear all text in textfield
Upvotes: 0
Views: 2366
Reputation: 137
I alreadty found the solution by aad id to clear button like
<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+
B+".datepicker._clearDate(this);\" id = "BTClear" >Clear</button>
and you can use clear by id like html button
Upvotes: 1