Form: ADD Submit button destination/action

Created on 4 March 2025, 29 days ago

Problem/Motivation

I am struggling to configure action for custom submit button. Once I submit it, the page is just reloaded, how can i configure the action so for example it will be redirected to node/1? (I would say this destination should be optional in FORM: ADD SUBMIT Button so it is clear what will happen once submitted, but it is not :(

I have tried so many variations, but non of it worked.

Can anyone guide me please ? I believe it must be a very simple solution.

πŸ’¬ Support request
Status

Active

Version

2.1

Component

Documentation

Created by

πŸ‡ΈπŸ‡°Slovakia coaston

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @coaston
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    You can use the form submit event. That is dispatched when the user submits your form. And then you can use actions like "Set form-state redirect" to tell Drupal what to do when the submission is being completed.

  • πŸ‡ΈπŸ‡°Slovakia coaston

    Thank you. I think this is exactly what I have done like 10times already but the problem is that in that case also the default save button is impacted and both save/submit and custom button redirects to same destination. But i only need the custom button to redirect there.
    Button has "trigger name" so i wanted to try condition form:compare triggered submission but still does not work.

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    For that I'm using the Form: compare triggered submission condition and it works as expected.

  • πŸ‡ΈπŸ‡°Slovakia coaston

    Thank you, I started from the scratch and somehow it is working now with above Forms.

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen
Production build 0.71.5 2024