bootstrap-datepickerで取得した年月日を個別の[年][月][日]
テキストボックスに埋め込みたいのですが、どのようにしたらよいか分かりません。
<table id="pt1" border="1" class="table"> <tbody> <tr> <th>実施日</th> <td> <input type="text" id="target_year" name="target_year" size="4" maxlength="4" class="inp" value="" />年 <input type="text" id="target_month" name="target_month" size="2" maxlength="2" class="inp" value="" />月 <input type="text" id="target_day" name="target_day" size="2" maxlength="2" class="inp" value="" />日 <input type="button" id="dp_pos1" name="dp_pos1" value="日付選択" /> </td> </tbody> </table> コード $(function() { $('#dp_pos1').datepicker( { //カレンダーが閉じたあとの処理(各テキストボックスに値を分配) onClose : function(date) { if ( date.length > 0 ) { $('#target_year').val(date.split("/")[0]); $('#target_month').val(date.split("/")[1]); $('#target_day').val(date.split("/")[2]); } } }); });
どのようにすれば振り分けができるでしょうか?
教えて下さい。
宜しくお願いいたします

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/04/06 15:58
2016/04/06 16:20
2016/04/07 04:21