js client officially done

This commit is contained in:
2024-05-06 18:39:27 +02:00
parent 1e6e576318
commit aaf0fd6623
8 changed files with 374 additions and 264 deletions

View File

@@ -9,9 +9,6 @@
<body>
<h1>Customers</h1>
<br>
<a href="#add" class="bookmark">Want to add a new line?</a>
<br>
<br>
<table class="queryresults">
<thead>
<tr>
@@ -23,7 +20,6 @@
<tbody id="resultarea">
</tbody>
</table>
<h2 id="add">Add a new line</h2>
<div id="forms"></div>
<h2 id="saveresult"></h2>
</body>

View File

@@ -32,7 +32,7 @@ function display()
document.getElementById('resultarea').innerHTML +=
'<tr>' +
'<td colspan="4">' +
'<a class="bookmark" href="#add">Add new</a>' +
'<button type="button" onclick="addcustomer()">Add new</button>' +
'</td>' +
'</tr>';
}
@@ -77,7 +77,7 @@ function editcustomer(id)
'<table class="inputs">' +
'<tr>' +
'<td>ID</td>' +
'<td class="inputcell"><input type="text" id="in_id" readonly value="' + existing_item.id + '"></td>' +
'<td style="background-color: rgba(0, 0, 0, 0.1);" class="inputcell"><input type="text" id="in_id" readonly value="' + existing_item.id + '"></td>' +
'</tr>' +
'<tr>' +
'<td>Name</td>' +
@@ -130,6 +130,7 @@ function savecustomer(method)
.then(data => {
console.log("Success: ", data)
document.getElementById('forms').innerHTML = '';
document.getElementById('saveresult').innerHTML = '';
document.getElementById('saveresult').innerHTML +=
'Saved customer ' + customer_name + ' successfully';