0
내용에 입력 양식 필드가있는 내 페이지에 아코디언 설정이 있습니다. 입력 필드를 순환하여 아코디언 섹션의 끝에 도달하면 탭에서 다음 아코디언 섹션의 헤더를 선택하고 싶습니다. 하지만 제출 버튼의 끝으로 넘어갑니다. 어떻게 수정해야합니까? 내가 몇 가지 코드를 공유 할 수 있습니다 :
HTMLTab 다음 요소 선택
<input type="radio" class="radioBoxHide " name="byemail" id="byemail" value="byemail" data-panel="pageDetails" />
<h2 class="radioBoxInActive radioBoxActive">Page Details</h2>
<div class="tab-content" id="pageDetails">
<form name="pageDetails" action="" method="">
<div class="moduleRow" >
<label class="reqd" for="prCategory">Primary Category</label>
<select id="prCategory">
<option value="value1">Value 1</option>
<option value="value2">Value 2</option>
</select>
</div>
</form>
</div>
<input type="radio" class="radioBoxHide " name="byemail" id="byemail" value="byemail" data-panel="productDetails" />
<h2 class="radioBoxInActive">Product Details</h2>
<div class="tab-content" id="productDetails">
<form name="productDetails" action="" method="">
<div class="moduleRow" >
<label for="displayName">Display Name</label>
<input type="text" name="displayName" id="displayName" value="" />
</div>
<div class="moduleRow" >
<label for="shortTitle">Short Title</label>
<input type="text" name="shortTitle" id="shortTitle" value="" />
</div>
</form>
</div>
과 자바 스크립트 : 당신이 tabIndex를 찾고있는 것처럼
$(function() {
var app = this;
$("#siteLabel, #pageLabel, #articlelabel, #productlabel").hide();
$(".tabs-control label").click(function() {
input = $(this).prev("span, input");
$(".selected", app.element).removeClass("selected").hide();
$(".radioBoxActive", app.element).removeClass("radioBoxActive");
$("#" + input.attr("data-panel")).show().addClass("selected");
$(this).addClass("radioBoxActive");
});
$("select").change(function() {
var str = "";
$("select option:selected").each(function() {
$(".selecteddd", app.element).removeClass("selecteddd").hide();
str += $(this).attr("data-panel") + " ";
$("#" + $(this).attr("data-panel")).show().addClass("selecteddd");
});
}).change();
if ($(".tabs-control").hasClass('newProduct')) {
$("#pageDetails, #productDetails, #imageFields, #addInfo, #nutriInfo").hide();
}
var selected = $(".radioBoxActive");
input = selected.prev("input");
$("#" + input.attr("data-panel")).show().addClass("selected");
$("h2.radioBoxInActive").click(function() {
input = $(this).prev("span, input");
$(".selected", app.element).removeClass("selected").slideUp();
$(".radioBoxActive", app.element).removeClass("radioBoxActive");
$("#" + input.attr("data-panel")).slideDown().addClass("selected");
$(this).addClass("radioBoxActive");
});
});