How to link a button to a slide

Please forgive my explanation and terminology I am a newbie but i want to learn.
So I have built a 10 page website with data fields on each page but when i tested it, i found that each page shows up on a different line in the database(this won’t work for me, I need all fields to show on one line). The Wix support workaround was to make one page with a slideshow and put all the data fields on the 10 slides. So here is where the 2 problems comes in…(1) the Required function creates an error (when i turn off “required” on all fields i don’t get an error".
(2) I have a NEXT button on each slide that has a “onclick” function as apposed to Wix’s suggestion of just using the Link function… I don’t know how to “link” a button to the next slide on the same page. Thank you in advance for ANY help. Hope I gave a clear enough explanation.

To link a button click to the next slide, you can use the following code:

$w("#button1").onClick((event) => {
$w("#slideshow1").next();
})

J.D. thank you for your quick response. I had that coded for each button but i was having other issues like the error code on the submit button on the last page.
This is what Ryan at wix sent regarding the “onclick”

Thank you for your patience while we investigated your issue. The issue is with the custom code you added to that page and the fact that you are using the next function. It is recommended to use the buttons like you originally have in the multistage form to navigate to the next slide instead of calling next with a onChange event as the user might skip the first input to enter the second and then it will automatically direct them to the next slide without completely filling out the form.

I’m not sure what was the original way,
but anyway you can write a code to disable the next() function if one of the input field is empty.

The “original” way was when i built all 10 pages on there own…the issue I had with that was the input fields on each page would have there own line in the data. I’m not that versed in the custom code…limited to pointing buttons to slides…but I have my partner working on it in about 45 min so i will share your suggestion with him and see if he can come up with the code needed… also we have the other issue that is I check “required” for any or all the input fields it produces an error on the submit button that is on the last page. any ideas about that issue…
Thank you again J.D.

Hi!
How would that apply to mobile?
I successfully added this code to link multiple buttons throughout a slideshow on desktop and then recreated the same slideshow to fit for mobile with adjusted code for the mobile-friendly view, but it gives me this error: “TypeError: $w(…).onClick is not a function”

How can this be done on mobile also?

Thanks in advance for any help!

(btw I’m not very code-savvy)

Hello, I was wondering if you found a solution to this? I am trying to link to a specific slide. Thank you.