채택완료

datepicker를 사용해서 글 수정할때

2016-10-12 (수) 16:33:55 4,112

datepicker를 사용해서 날짜를 선택하는 게시판이구요

31ff36168a87f824b59c6495f4ff42f6_1476257510_3705.JPG 

위의 사진처럼 글 수정시 datepicker는 정상적으로 작동도 하는데

value값은 새로 클릭한 10월3일로 변경되지가 않아서 날짜를 수정해도

데이터에 반영이 되지를 않습니다.ㅠㅠ

뭐가 문제일까요ㅠㅠ....??

작성된 코드는

Copy
<tr>            <th scope="row"><label for="wr_open_date">오픈날짜<strong class="sound_only">필수</strong></label></th>            <td>                <input name="wr_open_date" id="datepicker1" required class="frm_input required" size="15" value="<?php if($w=='u') {echo $write['wr_open_date'];} ?>" readonly>            </td>        </tr>

입니다ㅠㅠ

|

답변 3개 / 댓글 2개

채택된 답변
+20 포인트
2016-10-12 (수) 17:47:03

write_update.skin.php 파일에서

sql 문을 출력해서 보여주세요` 

답변에 대한 댓글 1개

하하하....진짜 update sql문을 찍어봤어야했는데ㅠㅠ이게 왠 삽질....ㅠㅠ
update문에서 없는 필드값이 있었네요.
감사합니다.
2016-10-12 (수) 17:32:07

Copy
<script type="text/javascript">jQuery(function($){	$.datepicker.regional['ko'] = {		closeText: '닫기',		prevText: '이전달',		nextText: '다음달',		currentText: '오늘',		monthNames: ['1월(JAN)','2월(FEB)','3월(MAR)','4월(APR)','5월(MAY)','6월(JUN)',		'7월(JUL)','8월(AUG)','9월(SEP)','10월(OCT)','11월(NOV)','12월(DEC)'],		monthNamesShort: ['1월','2월','3월','4월','5월','6월',		'7월','8월','9월','10월','11월','12월'],		dayNames: ['일','월','화','수','목','금','토'],		dayNamesShort: ['일','월','화','수','목','금','토'],		dayNamesMin: ['일','월','화','수','목','금','토'],		weekHeader: 'Wk',		dateFormat: 'yymmdd',		firstDay: 0,		isRTL: false,		showMonthAfterYear: true,		yearSuffix: ''};	$.datepicker.setDefaults($.datepicker.regional['ko']);     $('#wr_1').datepicker({        showOn: 'button',		buttonImage: '<?=$board_skin_path?>/img/calendar.gif',		buttonImageOnly: true,        buttonText: "달력",        changeMonth: true,		changeYear: true,        showButtonPanel: true,        yearRange: 'c-99:c+99',		minDate: '-0d',        maxDate: '+20d'    });});</script>

입력필드에서는

 

<input name="wr_1" id="wr_1" required class="frm_input required" size="15" value="<?php if($w=='u') {echo $write['wr_1'];} ?>" readonly> 


이런식으로 하시면 됩니다.

 

2016-10-12 (수) 17:18:59

datepicker 소스에 보시면 날짜 입력필드와 동일하게 잘 되어 있나요?

 

datepicker 소스를 보고 싶군요 ~ 

답변에 대한 댓글 1개

플러그인 폴더 jquery-ui 안에 datepick.php 파일입니다.
ㅠㅠ
[code]
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

add_stylesheet('<link type="text/css" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/themes/base/jquery-ui.css" rel="stylesheet" />', 0);
add_stylesheet('<link type="text/css" href="'.G5_PLUGIN_URL.'/jquery-ui/style.css">', 0);
?>

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
<script>
jQuery(function($){
$.datepicker.regional["ko"] = {
closeText: "닫기",
prevText: "이전달",
nextText: "다음달",
currentText: "오늘",
monthNames: ["1월(JAN)","2월(FEB)","3월(MAR)","4월(APR)","5월(MAY)","6월(JUN)", "7월(JUL)","8월(AUG)","9월(SEP)","10월(OCT)","11월(NOV)","12월(DEC)"],
monthNamesShort: ["1월","2월","3월","4월","5월","6월", "7월","8월","9월","10월","11월","12월"],
dayNames: ["일","월","화","수","목","금","토"],
dayNamesShort: ["일","월","화","수","목","금","토"],
dayNamesMin: ["일","월","화","수","목","금","토"],
weekHeader: "Wk",
dateFormat: "yymmdd",
firstDay: 0,
isRTL: false,
showMonthAfterYear: true,
yearSuffix: ""
};
$.datepicker.setDefaults($.datepicker.regional["ko"]);
$('.ui-datepicker ').css({ "margin-left" : "141px", "margin-top": "-223px"}); //달력(calendar) 위치
});
</script>
[/code]

답변을 작성하려면 로그인이 필요합니다.