typo in app.py + clear input field on submit in web part

This commit is contained in:
2024-01-31 23:52:51 +01:00
parent c7a4bc711d
commit 17b4224771
2 changed files with 9 additions and 2 deletions

View File

@ -296,6 +296,10 @@ async function addItem() {
attributes: document.getElementById("addattributes").value
};
// clear input fields
document.getElementById("additemid").value='';
document.getElementById("addattributes").value='';
const requestOptions = {
method: 'POST',
headers: {
@ -312,6 +316,9 @@ async function addItem() {
if (response.ok) {
console.log(response);
// reload window to display new item
location.reload();
} else {
throw new Error('Error in server response');
}