Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Back Button

sajan0192
Giga Expert

Hi All

I have a UI page on that I added a button like back button which we have OOB on records.

I want that button should behave like OOB button. But I am unable to find any solution for navigating user to previous page.

Any one knows how to achieve this?

Regards,
Sajan

1 ACCEPTED SOLUTION

Gurpreet07
Mega Sage

Hi Sajan,



In a link simply add below on onClick.


<a onClick="window.location=history.back()">Back</a>


View solution in original post

8 REPLIES 8

thoma5
Giga Contributor

got it : onClick="window.history.go(-1)"

Hi...seeing this post.

I'm using your script in the HTML of a newly created widget...appears to be working as far as taking me to the previous page.  However, when I hold my mouse over "Back", I don't see the hand pointing icon, I see something like a capital "I" bracket looking icon.  Is it possible get it to look like a normal link on a webpage?

Am I using this script correctly?   I'm trying to use it to create a "Back" button in Service Portal.

Here's my widget script:

HTML:

<div>
<a onClick="window.history.go(-1)">Back</a>
</div>

 

Client:

api.controller=function() {
/* widget controller */
var c = this;
};

 

Server:

(function() {
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */

})();

Hi Patric, Try cursor css in HTML section

 

<div>
<a onClick="window.history.go(-1)" style="cursor: pointer;">Back</a>
</div>

Perfect, thanks Gurpreet!