Titans (Oscar Screening Camp) Read Only
Specific Folder FTP Upload / ftp-deploy (push) Successful in 32s
Details
Specific Folder FTP Upload / ftp-deploy (push) Successful in 32s
Details
This commit is contained in:
parent
01ba974a6f
commit
cfd9ed6641
|
|
@ -185,7 +185,7 @@
|
|||
@include('layouts.shared/footer-script')
|
||||
<script src="{{asset('assets/libs/sweetalert2/sweetalert2.min.js')}}"></script>
|
||||
<script src="{{ asset('assets/libs/select2/select2.min.js') }}"></script>
|
||||
{{-- <script type="text/javascript">
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function($){
|
||||
$('#field-msl_code').prop('readonly',true);
|
||||
$('[data-toggle="select2"]').select2();
|
||||
|
|
@ -275,107 +275,9 @@
|
|||
plandateField.setAttribute('max', today);
|
||||
}
|
||||
});
|
||||
</script> --}}
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function($){
|
||||
// 1. आधी fields readonly करा
|
||||
$('#field-msl_code, #field-speciality').prop('readonly', true);
|
||||
|
||||
// 2. Select2 initialize करा
|
||||
$('[data-toggle="select2"]').select2();
|
||||
|
||||
// 3. Contact change event (फक्त एकदाच लिहा)
|
||||
$('#field-contact_id').on('change', function() {
|
||||
let selectedOption = $('option:selected', this);
|
||||
$('#field-msl_code').val(selectedOption.attr('msl_code') || '');
|
||||
$('#field-speciality').val(selectedOption.attr('speciality') || '');
|
||||
});
|
||||
|
||||
// 4. User / Territory change event
|
||||
$('#field-user_id').on('change', function(event){
|
||||
event.preventDefault();
|
||||
let hierarchy = $('option:selected', this).attr('hierarchy');
|
||||
$('#field-hierarchy_id').val(hierarchy);
|
||||
|
||||
$("#pageloader").fadeIn();
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: '/form/getdoctorlist?partition={{$form->partition}}&hierarchy=' + hierarchy,
|
||||
success: function( data ) {
|
||||
$("#pageloader").fadeOut();
|
||||
let contactSelect = $('#field-contact_id');
|
||||
contactSelect.empty().append($("<option></option>").attr("value", '').text('-- Select --'));
|
||||
|
||||
for (let itm of data) {
|
||||
contactSelect.append(
|
||||
$("<option></option>")
|
||||
.attr("value", itm.value)
|
||||
.text(itm.display)
|
||||
.attr("msl_code", itm.contact.msl_code)
|
||||
.attr('speciality', itm.contact.speciality)
|
||||
);
|
||||
}
|
||||
// नवीन लिस्ट लोड झाल्यावर change trigger करा जेणेकरून जुनी value निघून जाईल
|
||||
contactSelect.trigger('change');
|
||||
},
|
||||
error: function() {
|
||||
$("#pageloader").fadeOut();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Page load झाल्यावर एकदा change trigger करा
|
||||
$('#field-contact_id').trigger('change');
|
||||
|
||||
// Text validation
|
||||
$('#field-city, #field-state, #field-departmental_head_name').on('input', function () {
|
||||
this.value = this.value.replace(/[^a-zA-Z\s]/g, '');
|
||||
});
|
||||
|
||||
// Form submit
|
||||
$('#report-form').on('submit', function(event){
|
||||
event.preventDefault();
|
||||
$("#pageloader").fadeIn();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '/form/ajaxsubmit',
|
||||
data: new FormData(this),
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function( data ) {
|
||||
$("#pageloader").fadeOut();
|
||||
if(data.status == 'success') {
|
||||
Swal.fire({
|
||||
title: 'Great!',
|
||||
text: 'Your data is successfully submitted!',
|
||||
icon: 'success'
|
||||
}).then(() => {
|
||||
location.reload();
|
||||
});
|
||||
$('#report-form').trigger("reset");
|
||||
} else {
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Data not submitted',
|
||||
text: 'Something went wrong, please try again after some time!'
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
$("#pageloader").fadeOut();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Date field check (एरर टाळण्यासाठी if condition लावली आहे)
|
||||
var plandateField = document.getElementById('field-record_date');
|
||||
if (plandateField) {
|
||||
var today = new Date().toISOString().split('T')[0];
|
||||
plandateField.setAttribute('max', today);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Loading…
Reference in New Issue