Skip to content

Update 'Submitting the Form via a LiveAction' #2684

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

BigBenJr
Copy link

@BigBenJr BigBenJr commented Apr 7, 2025

This pull request includes a change to the documentation in the src/LiveComponent/doc/index.rst file. The change clarifies the behavior of the form submission process when using the live#action:prevent attribute (section 'Submitting the Form via a LiveAction')

Documentation update:

  • src/LiveComponent/doc/index.rst: Updated the description to explain that the live#action:prevent attribute catches the form submission event and prevents the regular HTTP form submission.

Add explanation about action:prevent
@carsonbot carsonbot added the Status: Needs Review Needs to be reviewed label Apr 7, 2025
@smnandre smnandre added the docs Improvements or additions to documentation label Apr 13, 2025
Comment on lines +1555 to 1557
Now, when the form is submitted, the ``live#action:prevent`` catches the form submission event and prevents the regular HTTP form submission.
it will execute the ``save()`` method
via Ajax. If the form fails validation, it will re-render with the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Now, when the form is submitted, the ``live#action:prevent`` catches the form submission event and prevents the regular HTTP form submission.
it will execute the ``save()`` method
via Ajax. If the form fails validation, it will re-render with the
Now, when the form is submitted, the ``live#action:prevent`` catches the form submission event and prevents the regular HTTP form submission.
Then it will execute the ``save()`` method via Ajax. If the form fails validation, it will re-render with the

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation LiveComponent Status: Needs Review Needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants