Problem with Php Javascript Multistep Form

227 Views Asked by At

I have a problem with a php multistep form which should normally switch between different steps/forms in one single page.

However, when I click on the first "Next" button, instead of sliding to the next element, the page refreshes and displays the first step/form.

<button class="firstNext next">Next</button>

I hope someone can help me. Below are the CodePen references:

Debug CodePen : https://cdpn.io/ibx/debug/KKMzjJQ/PNrvYKqamoKM
Code: CodePen : https://codepen.io/ibx/pen/KKMzjJQ

Thank you for your help!

1

There are 1 best solutions below

0
On BEST ANSWER

I have changed the code to this and it worked!
nextBtnFirst.addEventListener("click", (event) => { event.preventDefault();