Jump to content
  • 0

Change URL depending on doprdown option


Dimitri

Question

1 answer to this question

Recommended Posts

  • 0

Hello @Dimitri

It is possible using additional JS code.

First of all, you should use custom link, like this:
 

<a href="" id="customLink">LINK</a>

You can insert it into HTML block of the submission form.

Then you should add the following code to change the href of your custom link. In the example, I use the Virtual1 field as the source with the link value:

<script type="text/javascript">

function changeLink(event) {
  document.querySelector('#customLink').href = event.target.value;
}

function changedHandler() {
 document.querySelector('input[name="cbParamVirtual1"]').addEventListener('change', changeLink);
 document.removeEventListener('DataPageReady', changedHandler);
}

document.addEventListener('DataPageReady', changedHandler);
</script>

Please note that the id of your link should be the same as querySelector() argument in the someAlert() function.

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...