so I am trying to build a multiple step form with two tabs, tab has a user name, while tab two has the password, on page load, tab one is visible, if i click the next button, i m hide the tab1 and show tab2 with jquery, but when tab two show, i m finding it difficult converting the next button submit button to enable me submit the form.
tried this
$(function () {
$('.tab1').show();
$('#cracc').show();
$('#nextBtn').on('click', () => {
/* $('#nextBtn').html('Submit'); */
$('.tab1').hide();
$('#cracc').hide();
$('.tab2').show(() => {
$('.forgotPass').show();
$('#nextBtn').html('Submit')
})
})
if (('.tab2').show()) {
$('#nextBtn').attr('type', 'submit')
$('#nextBtn').on('click', () => {
$('form').submit(() => {
alert('submitted')
})
})
}
})