G5에서 버튼 클릭시 폼값이 적용안됍니다.
<form name="fwrite" method="post" onsubmit="return fwrite_submit(this);" enctype="multipart/form-data" style="margin:0px;"> <table>....</table><input type="submit" value="작성완료" id="btn_submit" accesskey="s" class="btn_submit">..</form> <script type="text/javascript"></script> { f.action = "<?php echo $board_skin_url ?>/apply.php"; return true; } </script>
원래 G4에서 잘돌아가는대요 이상하게 G5로 옮긴후. 버튼 클릭시 apply.php를 호출해서 제가 지정한 항목에 업댓을 안합니다...
즉 위의 f.action = "<?php echo $board_skin_url ?>/apply.php";를 주석처리해도 저장이 됍니다.
그런대 제가 여유항목아닌 wr_subject 항목의 경우 빈값으로 전송돼내여...
버튼 클릭시 apply 호출 방법이 잘못됀것인지.. 그리고 어디서 자동저장돼는지.. G5를 잘모르겠습니다.
조언부탁드립니다.
답변 2개 / 댓글 1개
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가<!-- 게시판 목록 끝 -->// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨//add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);//include_once(G5_PLUGIN_PATH.'/jquery-ui/datepicker.php');// 선택옵션으로 인해 셀합치기가 가변적으로 변함$colspan = 13;if ($is_category) $colspan++;if ($is_good) $colspan++;if ($is_nogood) $colspan++;if ($is_checkbox) $colspan++;// 제목이 두줄로 표시되는 경우 이 코드를 사용해 보세요.// <nobr style='display:block; overflow:hidden; width:000px;'>제목</nobr>?> <!-- 게시물 작성/수정 시작 { --> <form name="fwrite" method="post" onsubmit="return fwrite_submit(this);" enctype="multipart/form-data" style="margin:0px;"> <!--<input type="hidden" name="uid" value="<?php echo get_uniqid(); ?>">--> <input type="hidden" name="w" value="<?php echo $w ?>"> <input type="hidden" name="bo_table" value="<?php echo $bo_table ?>"> <input type="hidden" name="wr_id" value="<?php echo $wr_id ?>"> <input type="hidden" name="sca" value="<?php echo $sca ?>"> <input type="hidden" name="sfl" value="<?php echo $sfl ?>"> <input type="hidden" name="stx" value="<?php echo $stx ?>"> <input type="hidden" name="spt" value="<?php echo $spt ?>"> <input type="hidden" name="sst" value="<?php echo $sst ?>"> <input type="hidden" name="sod" value="<?php echo $sod ?>"> <input type="hidden" name="page" value="<?php echo $page ?>"> <!-- 하단 리스트 선택시 필요 추가! ----> <? if($stx == "") { $month[0] = date("Y"); $now = date("Y-m"); } else { $tmp = $stx."-"; $month = explode("-", $stx); } ?> <? if(substr($stx, 0, 1) != "20") $month[0] = date("Y"); ?> <!-------------------------------------><table width="<?=$width?>" align=center cellpadding=0 cellspacing=0><div class='toparea clearb' align=center ><font color=white size="3px">L/C OPEN manager</font></div><br> <!-- 공백 줄나누기 ---><tr><td><table align=center> <!-- 입력블럭 --><td ><TABLE cellSpacing=3 cellPadding=2 width="650px" align=left bgColor=#eeeeee> <tbody> <tr> <th scope="row" bgColor=#d7d7d7><label for="wr_subject">Pellet 선택<strong class="sound_only">필수</strong></label></th> <td><SELECT id='wr_subject' name='wr_subject' required class="required" ><option value='Wood Pallet' <?if($write[wr_subject]=='Wood Pallet' || $write[wr_subject]=='')echo "selected";?>>Wood Pallet</option> <option value='Mix Pallet' <?if($write[wr_subject]=='Mix Pallet')echo "selected";?>>Mix Pallet</option> <option value='Rice HuskPallet' <?if($write[wr_subject]=='Rice HuskPallet')echo "selected";?>>Rice HuskPallet</option></SELECT> </td> </tr> <tr> <th scope="row" bgColor=#d7d7d7><label for="wr_1">구매처(Seller)</label></th> <td ><input type="text" name="wr_1" itemname="구매회사" value="<?php if($w=="u"){echo$write['wr_1'];} ?>" required class="frm_input required" size="14"></td> <th scope="row" bgColor=#d7d7d7><label for="wr_2">원산지(수입국가)</label></th> <td ><input type="text" name="wr_2" itemname="원산지" value="<?php if($w=="u"){echo$write['wr_2'];} ?>" class="frm_input" size="14"></td> </tr> <tr> <th scope="row" bgColor=#d7d7d7><label for="wr_3">총량(MetricTon)<strong class="sound_only">필수</strong></label></th> <td ><input type="text" name="wr_3" itemname="총량" value="<?php if($w=="u"){echo$write['wr_3'];} ?>" required class="frm_input required" size="14"> MT</td> <th scope="row" bgColor=#d7d7d7><label for="wr_4">단위가격(Unit Price)</label></th> <td ><input type="text" name="wr_4" itemname="단위가격" value="<?php if($w=="u"){echo$write['wr_4'];} ?>" class="frm_input" size="14"> <input type="radio" name="wr_9" value="원" checked> 원 <input type="radio" name="wr_9" value="USD" >USD </td> </tr> <tr> <th scope="row" bgColor=#d7d7d7><label for="wr_10">세액(원)</label></th> <td ><input type="text" name="wr_10" itemname="세액(원)" value="<?php if($w=="u"){echo$write['wr_10'];} ?>" class="frm_input" size="14"> 원</td> <th scope="row" bgColor=#d7d7d7><label for="wr_5">총수입가격(원)<strong class="sound_only">필수</strong></label></th> <td ><input type="text" name="wr_5" itemname="총수입가격" value="<?php if($w=="u"){echo$write['wr_5'];} ?>" class="frm_input" size="14"> 원</td> </tr> <tr> <th scope="row" bgColor=#d7d7d7><label for="wr_6">신용장번호(cf.<font color="blue">NU000</font>XX)</label></th> <td ><input type="text" name="wr_6" itemname="신용장번호" value="<?php if($w=="u"){echo$write['wr_6'];} ?>" class="frm_input" size="14"></td> <th scope="row" bgColor=#d7d7d7><label for="wr_last">선적기일(DateOfShipment)<strong class="sound_only">필수</strong></label></th> <td ><input type="text" name="wr_last" value="<?php echo $wr_last ?>" id="fr_date" required class="frm_input required" size="14"> 일 도착예정</td> </tr> <tr> <th scope="row" bgColor=#d7d7d7><label for="wr_content">참고사항(etc..)</label></th> <TD bgColor=#ffffff colspan=3 style='padding:5 0 5 0;'> <table width=100% cellpadding=0 cellspacing=0> </table> <textarea id=wr_content name=wr_content class=tx rows=2 itemname="참고사항" <? if ($write_min || $write_max) { ?>onkeyup="check_byte('wr_content', 'char_count');"<?}?>><?=$content?></textarea> <? if ($write_min || $write_max) { ?><script language="javascript"> check_byte('wr_content', 'char_count'); </script><?}?></TD> </tr> </tbody></table></td> <!-- 쓰기버튼!! --><td width="10px"></td><td align=left > <div class="bt_confirm"> <input type="submit" value="작성완료" id="btn_submit" accesskey="s" class="btn_submit"> <a href="./board.php?bo_table=<?php echo $bo_table ?>" class="btn_cancel">취소</a> </div></td><td width="10px"></td> <!-- 요약 리스팅!!! ---><td><TABLE width="300px" align=center > .....</table></td><!-- 버튼 리스트!!!---><td><TABLE width="150px" align=left > .....</table></td></table></td></tr></table></form></td></tr></table> <script type="text/javascript"> function fwrite_submit(f) { f.action = "<?php echo $board_skin_url ?>/apply.php"; //f.submit(); return true; } </script><script type="text/javascript">with (document.fwrite) { if (typeof(wr_subject) != "undefined") wr_subject.focus(); else if (typeof(wr_subject) != "undefined") wr_subject.focus(); else if (typeof(wr_content) != "undefined") wr_content.focus(); if (typeof(ca_name) != "undefined") if (w.value == "u") ca_name.value = "<?php echo $write[ca_name]?>";}</script><?php if ($is_checkbox) { ?><script type="text/javascript">function all_checked(sw) { var f = document.fboardlist; for (var i=0; i<f.length; i++) { if (f.elements[i].name == "chk_wr_id[]") f.elements[i].checked = sw; }}function check_confirm(str) { var f = document.fboardlist; var chk_count = 0; for (var i=0; i<f.length; i++) { if (f.elements[i].name == "chk_wr_id[]" && f.elements[i].checked) chk_count++; } if (!chk_count) { alert(str + "sesect item to delete."); return false; } return true;}//선택한한 게시물 Complete!!function select_complete() { var f = document.fboardlist; str = "..Complete.........."; if (!check_confirm(str)) return; if (!confirm("Will you Complete? : "+str)) return; f.action = "./b_complete.php"; f.submit();} // 선택한 게시물 삭제function select_delete() { var f = document.fboardlist; str = "Delete !!! "; if (!check_confirm(str)) return; if (!confirm("Will you delete? : "+str)) return; f.action = "./delete_all.php"; f.submit();}</script><?php } ?> <!-- 게시판 목록 끝 -->
다시 올립니다.. 문제는..
1. 버튼 클릭시 저장은 돼지만 select 항목(wr_subject)이 빈공백으로 나옵니다.
2. 버튼 클릭시 apply.php를 호출해야하는대. apply 항목을 주석처리해도 저장이 됍니다.
--> 즉. 버튼 클릭시 apply 항목을 통하지 않고 저장돼는듯 싶습니다.
3. 결론은 select항목 처리를 잘못했거나. 폼전송처리 잘못으로 apply 를 부르지 못하는경우.
어디서 확인해야할지 몰겠습니다. 조언 부탁드립니다. (__
<script type="text/javascript">
</script>
{
f.action = "<?php echo $board_skin_url ?>/apply.php";
return true;
}
</script>
이부분 잘못되었네요.
<script type="text/javascript">
function fwrite_submit(f){
~~~~
}
</script>
이렇게가 아닌가 싶네요
답변에 대한 댓글 1개
답변을 작성하려면 로그인이 필요합니다.
<script type="text/javascript">
function fwrite_submit(f)
{
f.action = "<?php echo $board_skin_url ?>/apply.php";
return true;
}
</script>
이렇게 돼있습니다..