css
This commit is contained in:
parent
153c74bd22
commit
9287290479
11 changed files with 321 additions and 24 deletions
15
comp/form.js
Normal file
15
comp/form.js
Normal 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;
|
Loading…
Add table
Add a link
Reference in a new issue