Closed djyotta closed 3 months ago
@lovasoa will do. Still testing it. I had some trouble with applying it to the textarea input directly. Seems adding it to the submit button works.
I want to make sure this works with also a file input present as they would both trigger adding the attribute to the submit button...
Okay, good! Switching this pr to draft mode, then. Feel free to switch it back whenever you want.
@lovasoa after reading the following:
I decided to expose the enctype
as top-level attribute as formenctype
is intended for submit
and image
type inputs only.
Further, I would suggest we remove the formenctype
being added automatically when file type input is present. Even though it's nice for newbies, there are the following short-comings:
enctype
- could be confusing when dev explicitly sets thisFor now I updated the docs recommending to set it explicitly for file upload rather than rely on current behaviour. I also added an example of setting different formenctype
on submit buttons to labour the point.
We can decide whether to alter existing behaviour independently of this PR
I understand what you mean. But the whole promise of SQLPage is to make it easy to build UIs on top of databases without any other knowledge than just sql. I really think file upload should work by default, and not require even knowing what formenctype means.
For reference - here is proposed changes that I think will make the handling of form encoding to work intuitively whilst still allowing flexability for developer to set specific encoding
No problem. Thanks for SQLpage making UI easy.
Sorry I couldn't catch the vision on this one. It's hard to see the forrest through the trees sometimes.
Closes #458