Require a link to be clicked before proceeding to next step

heathers_
Kilo Sage

We have a requirement to require a link to be clicked before proceeding to the next step. We are flexible in the manner of "next step", whether it be a button or a checkbox. 

 

Examples:

1. Pop-up that requires a link to be clicked before selecting "Next and/or Ok" and proceeding with submit.

2. Link on record (exact scenario is "Incident") and a checkbox that can't be selected until the link has been clicked.

 

Thank you!

1 REPLY 1

YaswanthKurre
Giga Guru

Hi Heather,

 

Implementation as per my understanding:

1. Create a Custom Field to Track Link Click

  • Field Name: u_link_clicked
  • Type: String Boolean
  • Default Value: false
  • Visible: No (hide it from the form)
    This field will be updated automatically when the link is clicked.

Script for link:  should be a html field or string field

<a href="https://your.policy.link" target="_blank" onclick="updateLinkClicked()">Test</a>

 

create a client script:

function onLoad() {
 
  // Define the function globally so it's accessible from the link
  window.updateLinkClicked = function () {
    g_form.setValue('u_link_clicked', 'true');
    alert("Thank you!.");
  };
}

 

Additionally you can use BR to prevent from moving to next steps: add your condition

if (current.u_link_clicked != 'true') {
  gs.addErrorMessage("You must click the policy link before submitting.");
  current.setAbortAction(true);
}

 

Please mark this as helpful and correct if this resolved your issue

 

Thanks,

Yaswanth