3 ms·
FormData is hilarious. https://developer.mozilla.org/en-US/docs/Web/API/FormData https://developer.mozilla.org/en-US/docs/Web/API/FormData Uhh, JSON would hav
by 6510 5y ago
FormData is hilarious.
https://developer.mozilla.org/en-US/docs/Web/API/FormData https://developer.mozilla.org/en-US/docs/Web/API/FormData
Uhh, JSON would have been nice I guess?
When I got frustrated with the user needing to be able to re-edit a form with waaay to many fields and the option to add more fields of various exotic types. I wrote a hilarious hack where I just went over the input elements and elm.setAttribute("value", elm.value). Then I rip out the entire form innerHTML, POST it and store it in the database. Want to edit it again? Here you go! When displaying the content wrap the form in: <fieldset disabled="disabled"> and add some border:0;color:black
For such a terrible idea it looked remarkably clean.