Go offline with the Player FM app!
Advanced htmx: hx-encoding
Manage episode 410234398 series 3550795
An amazingly simple file uploading form *with a progress bar* using htmx:
hx-encoding='multipart/form-data'
hx-post='/[where-you-want-post-it]'
hx-target='#target-div'>
Upload
<br> htmx.on('#form', 'htmx:xhr:progress', function(evt) {<br> htmx.find('#progress').setAttribute('value', evt.detail.loaded/evt.detail.total * 100)<br> });<br>
67 episodes
Manage episode 410234398 series 3550795
An amazingly simple file uploading form *with a progress bar* using htmx:
hx-encoding='multipart/form-data'
hx-post='/[where-you-want-post-it]'
hx-target='#target-div'>
Upload
<br> htmx.on('#form', 'htmx:xhr:progress', function(evt) {<br> htmx.find('#progress').setAttribute('value', evt.detail.loaded/evt.detail.total * 100)<br> });<br>
67 episodes
All episodes
×Welcome to Player FM!
Player FM is scanning the web for high-quality podcasts for you to enjoy right now. It's the best podcast app and works on Android, iPhone, and the web. Signup to sync subscriptions across devices.