Popup modale per inserimento nuovo Tag

This commit is contained in:
Amministratore 2023-05-19 16:30:56 +02:00
parent d120e5eadc
commit 9bd14a3830

View File

@ -6,14 +6,7 @@
</div> </div>
<div class="container"> <div class="container">
<!-- Content here --> <!-- Content here -->
<form action="" method="POST"> <button class="btn btn-warning btn-detail open_modal_new">Nuovo Tag</button>
@csrf
<div class="mb-3">
<label for="tag" class="form-label">Tag</label> <input type="text"
class="form-control" id="tag" name="tag_name">
</div>
<button type="submit" class="btn btn-primary">Inserisci nuovo Tag</button>
</form>
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-bordered table-hover" <table class="table table-striped table-bordered table-hover"
id="tags"> id="tags">
@ -67,6 +60,25 @@
</div> </div>
</div> </div>
</div> </div>
<div class="modal fade" id="myModal_new" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="row">
<div class="col-lg-12">
<form action="" method="POST">
@csrf
<div class="mb-3">
<label for="tag" class="form-label">Tag</label> <input
type="text" class="form-control" id="tag" name="tag_name">
</div>
<button type="submit" class="btn btn-primary">Inserisci nuovo Tag</button>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- /.col-lg-12 --> <!-- /.col-lg-12 -->
@ -87,6 +99,10 @@
$('#tag_id').val(data[0].id); $('#tag_id').val(data[0].id);
$('#myModal').modal('show'); $('#myModal').modal('show');
}); });
});
$(document).on('click','.open_modal_new',function(){
$('#myModal_new').modal('show');
}); });
}); });
</script> </script>