html and js for spliting lines
This commit is contained in:
parent
34b8368e9b
commit
9609ad426d
2 changed files with 81 additions and 0 deletions
25
app/static/split_line.js
Normal file
25
app/static/split_line.js
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
const addLineButton = document.getElementById("add-line-button");
|
||||
const lineContainer = document.getElementById('table-body');
|
||||
|
||||
function addLine(){
|
||||
const columns = ['Amount', 'Vendor', 'Confirmation Code', 'Note'];
|
||||
var tr = document.createElement('tr');
|
||||
var counter = 2;
|
||||
columns.forEach(column => {
|
||||
var td = document.createElement('td');
|
||||
var ip = document.createElement('input');
|
||||
ip.type = 'text'
|
||||
ip.classList = 'form-control'
|
||||
ip.name = `${column}-${counter++}`
|
||||
ip.placeholder = column
|
||||
td.appendChild(ip)
|
||||
tr.appendChild(td)
|
||||
})
|
||||
lineContainer.appendChild(tr)
|
||||
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
addLineButton.addEventListener('click', addLine)
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue