51 lines
1.9 KiB
PHP
51 lines
1.9 KiB
PHP
|
||
<div class="modal-dialog modal-lm">
|
||
<div class="modal-content">
|
||
|
||
<div class="modal-header">
|
||
<h4 class="modal-title" id="myModalLabel2"><?php echo $heading; ?></h4>
|
||
<button type="button" id="close-form" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
|
||
</button>
|
||
</div>
|
||
|
||
<form data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Asset/add_or_edit_LocationForm" >
|
||
<div class="modal-body">
|
||
<div class="x_content">
|
||
<br />
|
||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
||
<input type="hidden" name="id" value="<?php if(isset($location_data)) { echo $location_data->id; } ?>">
|
||
<input type="hidden" name="business_id" value="<?php echo user()->business_id; ?>">
|
||
|
||
<div class="form-group row">
|
||
<label class="col-form-label col-md-3 col-sm-3 ">Location</label>
|
||
<div class="col-md-9 col-sm-9 ">
|
||
<input type="text" class="form-control" name="location" value="<?php if(isset($location_data)) { echo $location_data->location; } ?>">
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-secondary" data-dismiss="modal" id="close-form">Close</button>
|
||
<button type="submit" class="btn btn-primary"><?php echo $submit_button_title; ?></button>
|
||
</div>
|
||
</form>
|
||
<script>
|
||
document.querySelector('form').addEventListener('submit', function(event) {
|
||
var form = event.target;
|
||
var submitBtn = form.querySelector('button[type="submit"]');
|
||
|
||
if (!form.checkValidity()) {
|
||
form.reportValidity(); // Display validation error messages
|
||
event.preventDefault(); // Prevent form submission if it's not valid
|
||
submitBtn.disabled = false;
|
||
} else {
|
||
submitBtn.disabled = true;
|
||
}
|
||
});
|
||
</script>
|
||
</div>
|
||
</div>
|
||
|
||
|