0

This is a continuation of this:

https://www.drupal.org/project/webform/issues/3023984

I was able to redirect to a node/term url using the token based on the answer provided, great! However this is where it gets complicated. The first select list has three items, selecting one item will open a corresponding conditional second list - that is, there are 3 hidden list that will get displayed based on the selection of the first.

[webform_submission:values:ELEMENT_KEY:entity:url]

will work only for one list. How can I make ELEMENT_KEY be based on the selected list.

Thanks

  • The ELEMENT_KEY needs to be replaced with the name of entity_select element and then this token placed in the confirmation URL. – jrockowitz Jan 5 at 15:32
2

You need to set the selected node's URL as the confirmation URLs token.

Confirmation URLs token

Here is an example webform that redirects to the select node when submitted.

  • I did try adding the token on the confirmation URL, but it doesn't work. This is what I am trying to do: – yaach Jan 5 at 18:30
  • I did try adding the token on the confirmation URL, but it doesn't work. This is what I am trying to do: First select list = optionA , optionB and optionC. When I select optionB, a second select TERM list will show up with termB1, termB2, termB3. If I select optionC, then another select TERM list will show up with termC1, termC2, etc. Obviously every select term list has its own key. The confirmation url should be based on ther term selected, it doesn't matter what select TERM list is selected. – yaach Jan 5 at 18:36
  • 1
    You could use a computed twig element to calculate what the redirect confirmation URL should be or write some the custom code. – jrockowitz Jan 5 at 20:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.