adamwathan / bootforms

Rapid form generation with Bootstrap 3 and Laravel.
MIT License
417 stars 103 forks source link

Building Form using Ajax #124

Closed Iseldore closed 7 years ago

Iseldore commented 7 years ago

Hello,

I'm trying to build a form using ajax.

My controller method returns all the html rendered by the BasicFormBuilder class.

But errors on the form are not displayed (they are in session tho).

Is BootForm designed to be built in controller or always in the blade files ?

Thanks !

Laravel 5.3

adamwathan commented 7 years ago

BootForms is meant to be used in blade files with standard form submissions that perform redirects; it's really just a shortcut to avoid writing a bit of extra HTML manually. If you want to handle form submissions with AJAX, you'll have to write a bunch of JavaScript to hide/show your error messages on the client yourself, so no reason to use this package in that case honestly.