This commit is contained in:
biglyderv 2024-11-25 14:12:43 -05:00
parent 153c74bd22
commit 9287290479
11 changed files with 321 additions and 24 deletions

15
comp/form.js Normal file
View file

@ -0,0 +1,15 @@
function form(elems, action) {
elems.push({
'label': 'Submit',
'type': 'Submit',
'name': 'submit'
});
let mapped = elems.map(elem =>
`<span class='form-entry'> <span class='form-key'>${elem.label}</span> <input type='${elem.type}' name='${elem.name}'></span>`
).join('\n');
return `<form enctype='multipart/form-data' method='POST' action='${action}'><div class='form-message'></div>${mapped}</form>`
}
export default form;