Jump to content
  • 0

Custom Back button on Details DataPage that goes back to the search form


cordova

Question

Hi.

 

I'm using a Details DataPage with a search form and I'm aware that there is a 'Search Again' link that takes me back to the search form, but can I instead have a Back button beside the Update button that essentially behaves the same way as the 'Search Again' link?

 

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hi, 

You can try doing the following steps:

1. Add an HTML block, disable the HTML editor, and add the following:
<input name="BackButton" id="BackButtonID" value="Back" class="cbUpdateButton">

 

2. Add a Header & Footer. Select the Footer, disable HTML editor, and paste the following:

<script>

var element = document.getElementById("BackButtonID");
element.onclick = function(event) {

location.href = document.querySelector("a[data-cb-name='SearchAgainButton']").href;
}

</script>
 

What this does is create a function for the custom button so that when it is clicked, it takes you back to the href value of the 'Search Again' button. 

You can also hide the 'Search Again' field if you want, by using the following CSS:

 

<style>

.cbFormSearchAgainLink{
visibility: hidden;
}

</style>

 

Sample DP: https://c1hch576.caspio.com/dp/db26a00071004f6ee7ef445db600

 

 

Link to comment
Share on other sites

  • 0
On 3/1/2022 at 9:35 PM, futurist said:

1. Add an HTML block, disable the HTML editor, and add the following:
<input name="BackButton" id="BackButtonID" value="Back" class="cbUpdateButton">

Hi all. This solution only works when "Go back to results page" option is enabled under "Destination and messaging". Any suggestions on how to make it work with "Same form"?
Suggestions are much appreciated!
Regards

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...