使用以下小提琴,我试图创建一个预约约会的过程。
我希望能够选择一个咨询,然后单击我想要的咨询即可将我带到提供者。
有人可以建议我如何解决此问题吗? https://jsfiddle.net/shaunafitzgoo/w7d1ke8b/5/
错误似乎出在以下功能中:
function nextPrev(n) {
// This function will figure out which tab to display
var x = document.getElementsByClassName("tab");
// Exit the function if any field in the current tab is invalid:
if (n == 1 && !validateForm()) return false;
// Hide the current tab:
x[currentTab].style.display = "none";
// Increase or decrease the current tab by 1:
currentTab = currentTab + n;
// if you have reached the end of the form...
if (currentTab >= x.length) {
// ... the form gets submitted:
document.getElementById("regForm").submit();
return false;
}
// Otherwise, display the correct tab:
showTab(currentTab);
}
谢谢