$('#chargeEmail3').change(function(){
$('#chargeEmail3 option:selected').each(function() {
if($(this).val() == 'self'){
$('#chargeEmail2').val('');
$('#chargeEmail2').attr("disabled", false);
} else if ($(this).val == 'select'){
$('#chargeEmail2').val('');
$('#chargeEmail2').attr("disabled", false);
} else {
$('#chargeEmail2').val($(this).text());
$('#chargeEmail2').attr("disabled", true);
}
});
});
<tr>
<th scope="row"><label for="chargeEmail">담당자 이메일</label></th>
<td>
<div class="item">
<input type="text" id="chargeEmail" name="chargeEmail" class="in_text" style="width:100px;" value="" maxlength="20" title="이메일 아이디" /> @
<input type="text" id="chargeEmail2" name="chargeEmail2" class="in_text" style="width:100px;" value="" maxlength="20" title="이메일 아이디" />
<select name="chargeEmail3" id="chargeEmail3" title="직접선택" style="width:160px;">
<option value="self">직접입력</option>
<option value="naver.com">naver.com</option>
<option value="hanmail.net">hanmail.net</option>
<option value="nate.com">nate.com</option>
<option value="daum.net">daum.net</option>
<option value="paran.com">paran.com</option>
<option value="gmail.com">gmail.com</option>
<option value="hotmail.com">hotmail.com</option>
<option value="yahoo.co.kr">yahoo.co.kr</option>
<option value="empal.com">empal.com</option>
<option value="lycos.co.kr">lycos.co.kr</option>
<option value="korea.com">korea.com</option>
<option value="dreamwiz.com">dreamwiz.com</option>
<option value="freechal.com">freechal.com</option>
</select>
</div>
</td>
</tr>
'Client Standard > JavaScript & jQuery' 카테고리의 다른 글
[Js] 모바일, 웹 브라우저 체크 (0) | 2014.08.25 |
---|---|
[API] jQuery select box (0) | 2014.08.22 |
[Mobile] 체크하기 (0) | 2014.03.07 |
[multi file upload] 업로드시 input file Add (0) | 2014.02.21 |
[jQuery] Input[type=text] Enter 키 누르면 함수호출 (0) | 2014.01.03 |