채택완료

만들어주신 분이 여행을 떠났어요,,,

2018-12-01 (토) 22:51:22 3,324

때문에 나는 qa배낭여행중입니다. 유유

아래 코드가 이상하게 기본적으로 한국에 체크되게 해야 하는건데..표시한 것에 체크되어 있어요,,유유

<label for="wr_179" > <input type="radio" name="wr_179"  id="korea" checked="checked"  value="KOREA" <? if ($write['wr_179'] == 'KOREA') echo "checked"?> onclick="div_sh(1);">  한국</label>&nbsp;&nbsp;
    
  
        <label><input type="radio" name="wr_179"  id="other"  onclick="div_sh(2);" value="other" <? if ($write['wr_179'] != 'KOREA') echo "checked"?>> <img src="../skin/board/order/img/world32.png" width="32" height="32"  alt=""/>한국이외의 국가에서 수취   </label>
    
<? if($write['wr_179'] == 'KOREA' ) $hide ="none;"; else $hide="block;";   ?>

 <div id="d1" style="display:<?=$hide?>">         
&nbsp;&nbsp; <input type=text name='nation3' id='nation3' itemname='기타 국가' class="css-checkbox box" value='<?=$write['nation3']?>'  size='35' maxlength='50'  placeholder="수취 국가명을 영문으로 기재" required> </div>
 </td>

|

답변 2개 / 댓글 3개

채택된 답변
+20 포인트
2018-12-01 (토) 23:01:40

<label for="wr_179" >한국</label>

<input type="radio" name="wr_179"  id="korea" value="KOREA" <?php echo ($write['wr_179'] == 'KOREA')?"checked='checked'":"";?> onclick="div_sh(1);">

<label for='other'>한국이외의 국가에서 수취</label>

<input type="radio" name="wr_179"  id="other"  onclick="div_sh(2);" value="other" <?php echo ($write['wr_179'] != 'KOREA')?"checked='checked'":"";?>>

<img src="../skin/board/order/img/world32.png" width="32" height="32"  alt=""/>

<?php ($write['wr_179'] == 'KOREA' )?$hide ="none;":$hide="block;";?>

 <div id="d1" style="display:<?=$hide?>">         
   <input type=text name='nation3' id='nation3' itemname='기타 국가' class="css-checkbox box" value='<?=$write['nation3']?>'  size='35' maxlength='50'  placeholder="수취 국가명을 영문으로 기재" required> </div>
 </td>

이런식으로 써보세요

답변에 대한 댓글 2개

2018-12-01 (토) 23:35:57
알려주신 코드로 대체해보니..
한국 체크버튼 한국이외의 국가에서 수취 체크된 버튼
이렇게 나오네요...

라벨이 문제인가하고 라벨을 앞으로 뒤로 여러방법으로 해도 문제는 여전합니다.
프로그래머가 집어넣은 php코드와 div가 문제인거 같습니다.
2018-12-02 (일) 01:25:21
구글링해서 스크립트로 해결했습니다. 감사합니다.
2018-12-01 (토) 23:42:06

2009267558_1543675323.5313.gif

답변에 대한 댓글 1개

2018-12-01 (토) 23:42:31
알려주신 코드의 경우 이렇게 나옵니다.

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