typo in app.py + clear input field on submit in web part
This commit is contained in:
@ -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');
|
||||
}
|
||||
|
Reference in New Issue
Block a user