/* README - Usage Instructions
*
* IMPORT this file into your form using the following line:
* tip: stick it in a Text above/below field area to prevent it processing on the designer view
*
* INSERT PLACEHOLDER LINKS for requestLink.js to link to the Process Change Request Form. Here's a sample a.requestLink:
submit a change request
* requestLink.js will use the custom description attribute to build a URL parameter for the link.
*/
(function () {
const PCRFormLink = '/Forms/Process-Change-Request';
let process;
$(document).ready(function () {
process = document.getElementById('requestLinkScript').getAttribute('processname');
$('.requestLink').each(transformRequestLink);
});
function transformRequestLink(index, element) {
let description = element.getAttribute('description');
element.href = makeLink(description);
element.target = 'blank';
}
function makeLink(description) {
return PCRFormLink + '?Process=' + process + '&Description=' + description;
}
})();