New Discussion

Notifications

You’re not receiving notifications from this thread.

How to use HTML Button Form Attributes Discussion

6
General

This would have saved me a ton of time last year when I spend hours trying to organize the delete button. 🤦‍♂️

Totally agree with @Aaron ... I spent so much time making such dumb decisions with buttons like this and the episode would have saved me so much time 🤦🏼‍♂️ 🤣

I used to only know the basic tag for submitting forms, but I had no idea there were so many form-related attributes! 🤯
I especially found formaction and formmethod super useful since they let you control the behavior of each button without needing JavaScript. Like, you can send the form to a different URL depending on which button was clicked – that’s so convenient!

I’d love to see more real-life examples, like using multiple buttons in one form for different actions, such as “Save Draft,” “Submit,” or “Delete.”

Join the discussion
Create an account Log in

Learning Ruby on Rails? Join our newsletter.

We won't send you spam. Unsubscribe at any time.