1 year ago

Form action dynamically set

Posted 1 year ago by cservices

If there is another way to do this, please advise.

I have a form where the action is set to action="/category/store"

Below the form is a list of items with an edit button next to each. When the edit button is clicked the data is sent to the form and the action is changed to action="/category/update"

The problem is if the form has errors and redirects the action is reset to action="/category/store"

Is there a way to ensure the action retains the update path on a redirect due to failed validation?

Please sign in or create an account to participate in this conversation.