Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
good point, what do you think of stimulus reflex - https://docs.stimulusreflex.com/
I see it the following way: - Wrap a form into a Turbo Frame. - Attach a Stimulus controller to the form. - Listen for change events and perform a form submission (requestSubmit()) whenever an input value changed. - Use a specific parameter to distinguish real submissions from preview ones (e.g., by toggling a hidden input field value in the form): in the controller, do not call #save if it's a preview request; only render a form in response with validation errors. - The most challenging part: since the HTML contents of the form would be replaced, we need restore the cursor position and any new input data. I think, using morphdom solves this issue; that's how (I believe) Stimulus Reflex and optimism library in particular work.