skydiver / october-plugin-forms

Create easy (and almost magic) AJAX forms
https://octobercms.com/plugin/martin-forms
MIT License
60 stars 41 forks source link

Suggestion re Ajax Forms and Inline Errors #175

Closed gavinworks closed 4 years ago

gavinworks commented 5 years ago

BRILLIANT plugin!! Thank you!

Just a suggestion in case this is a gotch-ya for anyone else. I wanted inline errors for my Upload Ajax Form as well as my Generic Ajax Form. With the Upload Ajax Form, because the form is opened differently, you can't just add data-request-validate to the form tag.

With ajax forms you need to add it within the opening tag like this:

{{ form_ajax(__SELF__ ~ '::onFormSubmit', { class: 'md:w-3/5 pl-4 relative', validate: 'true'}) }}

Now inline errors will work for your Upload Ajax Forms too :)

I'm using TailwindCSS too so needed to add a class as well. Hope it helps some people! Maybe update this in the plugin itself?

skydiver commented 4 years ago

Thanks @gavinworks