Back & Forward / Previous & Next Navigation

Now that we've established the minimum requirements, defined our first slides, and styled our special sf- classes, you're probably wondering, "Hey, so I can press these continuation buttons ... And it all looks pretty ... But what if I want to change something I entered a few slides back in the input?"

... well. If you're asking yourself a question like that, this lesson is for you:

‍1. Add previous and next buttons

For the sake of simplicity, add two buttons in the lower right corner (outside the form block / wrapper) - similar to the above - and use any styles or classes like☝️

2. Add the respective attribute

Name   studio-form-0
Value   prev


Name   studio-form-0
Value   next


If you use more than 1 Studio Form on a page, you must increase the number accordingly. Studio Form starts counting its instances at 0 (as it is common practice in software development).

This means: if you want your back and forward buttons to work for your first form, just keep using "studio-form-0". If you want it to work for the second form, use "studio-form-1". If you want it to work for the third, use "studio-form-2" and so on...

3. sf-hide

sf-hide works just like the other sf classes. The reason we're discussing it now is that it's not that common - you'll most likely find the class when your previous button simply can't go back any further ☝️

Great. What comes next?

Continue with -> Progress bars and the like <-

Bonus: sf-hide on submit

Each [studio-form-${ index }] element is given the class "sf-hide" on successful submission. You can style it the same as the other sf- classes ☝️