-
Notifications
You must be signed in to change notification settings - Fork 0
/
formAddNew.js
35 lines (31 loc) · 965 Bytes
/
formAddNew.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
function addFromForm() {
const mainTableID = $('body table').attr('id');
checkTableBody(mainTableID);
$(`#${mainTableID} tbody`).append(addToTableHTML());
formClear();
}
function addToTableHTML() {
return `
<tr>
<td>
<button type='button'
onclick='productDisplay(this);'
data-id='${$("#imdbID").val()}'
class='btn btn-outline-warning rowButton'>
Edit
</button>
</td>
<td>${$("#title").val()}</td>
<td>${$("#introyear").val()}</td>
<td>${$("#imdbID").val()}</td>
<td>${$('#type').val()}</td>
<td>
<button type='button'
onclick='productDelete(this);'
class='btn btn-outline-danger rowButton'>
Delete
</button>
</td>
</tr>
`;
}