Creating a 'back' button - Post ID...

User 2214750 Photo


Registered User
15 posts

Hi all, I am sure this is going to be so simple I will smack my forehead, but I have tried everything and can't get this to work...

I am using SD V3 and I just want to create a button that lets users go back to the previous page they were on. I know how to do it in HTML, but have tried using the 'insert button' and adding a variety of the parameters it needs
"<form>
<input type="button" value="Go back!" onclick="history.back()">
</form>

in the button 'action ' box but can't get it to output the right syntax.

I know I could go into the HTML editor, but this shouldn't be necessary....so how you do you do this in V3 please?

Don't make me suffer anymore....thanks

User 2147646 Photo


Registered User
233 posts

Hi Brian,
For the Href enter javascript:history.back()

User 2214750 Photo


Registered User
15 posts

Thank you for the reply, however....
When you create a button in V£ there are two boxes that can be completed 'Form' and 'Action'

When I put that code in the 'Action' box, V3 generates this code in the webpage

<div class="container"><button type="button" class="button" formmethod="post" formaction="nojavascript...history.back()">Action</button>
</div>

But the button does nothing, what am I still doing wrong?
User 122279 Photo


Senior Advisor
14,454 posts

Well, your quoted code above says 'nojavascript' for starters...

Don't use a button, use a button link. You can pop it into a form or just add it to a container. Then you edit the text, and in the editor window you write 'Action', or 'Back' or whatever, and where you see a # you remove that and paste the code that Jamo provided. I think you need to upload it to make it work.

Attached it a wee file with two button links. The top one is sitting directly in a container, the second one is wrapped in a form. Both work for me.
Attachments:
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 2214750 Photo


Registered User
15 posts

Thank you for that, I will try it out

My webpage code quote was wrong and I tried to edit my post....I even deleted the post, and re-made it, but for some crazy reason it keeps publishing my original quote . So in the' formaction' it does actually say

javascript:history.back
User 2214750 Photo


Registered User
15 posts

Thank you both, that works great, even in preview.
:)

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.