0
라디오를 기반으로 숨김/표시되는 필드가 있습니다. 이전에 숨겨진 필드에 대한 jquery 유효성 검사기
때문에 로딩 페이지 동안 우리가 만들어 그것을 볼 수 난 당신이 프리젠 테이션 로직을 위해 사용하고있는 프레임 워크 모르는$(document).ready(function() {
if(edit) {
populateData();
}
$(radio).change(function(){
//here also we show hide text box based on radio value
})
function PopulateData() {
//This does select radio and based on same show/hide text field
}
$("myForm").validate(); // attaching validate . At this point field could be hidden or visible
$(savebutton).click(function(){
/*This does not validate text
field (visibleBasedOnRadio) which was hidden and made visible by either of above */
if($("myForm").valid() == false) {
return false;
}
});
});
<form id="myForm">
<radio>
<option 1>
<option 2>
</radio>
<input type="text" id="visibleBasedOnRadio" class="required" style="display:none"/>
</form>