일부 입력이 숨겨진 상태가 아닌 경우 "필수"로만 설정하도록 조언하고 있습니다.div가 숨겨져 있지 않은 경우에만 텍스트 입력이 필요합니까?
function ShowHide(){
if(document.getElementById('addressY').checked){
document.getElementById("addressT").style.display = "block";
} else {
document.getElementById("addressT").style.display = "none";
}
}
그리고 숨겨진 DIV 입력 양식의 예 : 당신은 모든 형태의 예에서 볼 수
<label class="col-md-4 control-label" for="radios"><b>Did you find an address where the company accepts payments?</b></label>
<div class="col-md-4">
<div class="radio"><label for="radios-1"><input id="addressY" name="spelling" onchange="ShowHide()" required="" type="radio" value="yes" /> Yes </label></div>
<div class="radio"><input id="addressN" name="spelling" onchange="ShowHide()" required="" type="radio" value="no" /> No</div>
</div>
</div>
<div id="addressT" style="display: none;">
<div class="form-group"><b><label class="col-md-4 control-label" for="Full Address">Please fill in the full address that you found.</label> </b>
<div class="col-md-4"><label for="radios-0">Make Check Payable To (Optional): <input class="form-control input-md" id="address1" name="address1" placeholder="" style="width: 100%;" type="text" /></label>
</div>
여기
내가 숨겨진 사업부를 표시하는 데 사용하는 자바 스크립트입니다 액션 here.이 작업을 수행하는 더 좋은 방법을 생각할 수 있다면이 말을 듣고 싶습니다. 나는 자바 스크립트와 jquery의 상대적인 초보자이다. 당신이 요소를 숨기고 문제가 너무 를 해결 한 후 라디오 버튼을 사용하지 않으면 다음
숨어 모두가 아마 –
을 할 것 해제하는 것은 내 도움이되는 대답 ??? –