시도 this 코드입니다.
HTML :
<div class="Steps Step_1">
<h1>Step 01</h1>
<input id="txtStep_1" type="text" value="" />
<button id="btnNext" data-next="Step_2">Next</button>
</div>
<div class="Steps Step_2" style="display: none;">
<h1>Step 02</h1>
<input id="txtStep_2" type="text" value="" />
<button id="btnNext" data-next="Step_3">Next</button>
</div>
<div class="Steps Step_3" style="display: none;">
<h1>Step 03</h1>
<input id="txtStep_3" type="text" value="" />
<button id="btnNext">Next</button>
</div>
자바 스크립트 :
var current = 1;
$('button').on('click', function() {
if (!window["ValidateStep_" + current]())
alert('fill form..');
current++;
$('.Steps').hide();
$('.Step_' + current).show();
})
window.ValidateStep_1 = function() {
return true;
}
window.ValidateStep_2 = function() {
return true;
}
window.ValidateStep_3 = function() {
return false;
}
그것은 유효한 '와 함께 할 수있어()'하지만 당신은 당신이 전체 응답을 받게 될 경우 현재 코드를 첨부해야합니다. –