Datepicker から選択した日付を取得し、選択した値を別のテキスト ボックスに入力できるようにする必要があります。現在、次のonClose
ような関数を使用しています。
$('#defaultDate').datepicker({
onClose:function(theDate) {
$('#txtEntry1').text = theDate;
}
});
Datepicker から選択した日付を取得し、選択した値を別のテキスト ボックスに入力できるようにする必要があります。現在、次のonClose
ような関数を使用しています。
$('#defaultDate').datepicker({
onClose:function(theDate) {
$('#txtEntry1').text = theDate;
}
});
もっと簡単な方法があります。組み込みのalt-field オプションを使用すれば完了です。
altFieldおよびaltFormatオプションを使用して日付が選択されるたびに、代替フィールドに独自の日付形式を入力します。この機能を使用して、ユーザーが選択できるように人間にわかりやすい日付を提示し、さらに処理するためにコンピューターにわかりやすい日付を渡すことができます。
Have you looked through the docs? http://docs.jquery.com/UI/Datepicker#events
onSelect function(dateText, inst)
Allows you to define your own event when the datepicker is selected. The function receives the selected date as text and the datepicker instance as parameters. this refers to the associated input field. Code examples
Supply a callback function to handle the onSelect event as an init option.
$('.selector').datepicker({
onSelect: function(dateText, inst) { ... }
});