Active-CSS / active-css

The epic event-driven browser language for UI with functionality in one-liner CSS. Over 100 incredible CSS commands for DOM manipulation, ajax, reactive variables, single-page application routing, and lots more. Could CSS be the JavaScript framework of the future?
https://activecss.org
Other
42 stars 7 forks source link

Fix ajax checkbox issue and add file upload support for ajax form commands #321

Closed bob2517 closed 1 year ago

bob2517 commented 1 year ago

Noticed yesterday while working on a "contact us" form scenario that values of checkboxes are not being sent - only "on". That needs fixing, default as "on" only if no value set.

Also, check if file uploads are being handled correctly and set this up if not.

This will gets a sooner release than usual, as it is urgently needed.

bob2517 commented 1 year ago

Checkbox fix now on 2.12.1 branch.

bob2517 commented 1 year ago

Checkbox handling added to technical article on ajax form submits in the docs.

bob2517 commented 1 year ago

Prelim code is now in the core to handle the upgrade. Just need to write the tests and attach the files to the new FormData object which is only being used if files are present. Multipart content type is set automatically to replace the usual header if files are present. This will be a backward compatible upgrade.

bob2517 commented 1 year ago

Now on the branch. No additional syntax is necessary for file uploads to work in a form which uses ajax-form-submit or preview. Supports multiple property in file tag. Files seem to be arriving on the server ok. It has automatic setting of header "multipart/form-data" when there is a file, otherwise it respects the mime type in the ajax command.

Will play around with it this week to make sure it's adequate on a production site, and do a release next week if all looks good.

bob2517 commented 1 year ago

Closing pending release.