채택완료

두개 중 하나의 값만 입력하는 방법

Copy
<script type="text/javascript">			$(document).ready(function(e){				function chg(idx){				if(idx=="1"){					$("#wr_6").prop('readonly', true);					$("#wr_6").val("");					}else if(idx=="2"){ 					$("#wr_7").prop('readonly', true);					$("#wr_7").val("");					}				}			});		</script>  <input type="text" name="wr_4" value="<?php echo $wr_4 ?>" id="wr_4" class="frm_input" size="20" maxlength="20" required onchange="chg('1')">						<select name='wr_6' id='wr_6' style="width:98px;height:24px;" onchange="chg('2')">				<option value=''>직접입력</option>

input에 값이 있으면 select는 선택이 되지 않고 select에 값이 있으면 input엔 값을 못 적어야 하는데.

어떤 방식으로 만들어야 할까요.

|

답변 1개

채택된 답변
+20 포인트

<?if(값){?>

값이있다

<?}else{?>

없다

<?}?>

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