Separate div for form and error of deletion

to preserve form while showing error
This commit is contained in:
Salman Shaikh 2021-09-30 10:08:35 +05:30
parent 5731f67956
commit c2c6ad0252
3 changed files with 67 additions and 65 deletions

File diff suppressed because one or more lines are too long

View File

@ -8,6 +8,7 @@
<input type="text" id="deletion-token" value="" placeholder="Please enter the deletion token">
<a href="#" id="confirm-delete" class="btn-cta btn"> confirm</i> </a> <br/><br/>
</div>
<div id="error"></div>
</div>
</div>
</div>

View File

@ -51,9 +51,10 @@ $(document).ready(function() {
xhr.onreadystatechange = function() {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
deleteModal.find('#web').html('<span style="clear:both">File deleted</span></div>');
deleteModal.find('#web').html('<span style="clear:both">File deleted</span>');
deleteModal.find('#error').html('')
} else {
deleteModal.find('#web').html('<span>Error (' + xhr.status + ') during deletion of file</span>');
deleteModal.find('#error').html('<span>Error (' + xhr.status + ') during deletion of file</span>');
}
}
};