Titans (ISP Reporting) Show & Hide
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m36s
Details
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m36s
Details
This commit is contained in:
parent
9ecdefa7e0
commit
9b64bb784b
|
|
@ -345,6 +345,69 @@
|
||||||
});
|
});
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
let docNameFields = document.querySelectorAll('#field-contact_id');
|
||||||
|
let mslCodeFields = document.querySelectorAll('#field-legacy_code');
|
||||||
|
|
||||||
|
//Hide all doctor fields
|
||||||
|
hideDoctorFields();
|
||||||
|
// docNameFields.forEach((docField, index) => {
|
||||||
|
// if(index !== 0)
|
||||||
|
// $(docField).parent().hide();
|
||||||
|
// })
|
||||||
|
//Hide all msl code fields
|
||||||
|
hideMSLCodeFields()
|
||||||
|
// mslCodeFields.forEach((mslField, index) => {
|
||||||
|
// if(index !== 0)
|
||||||
|
// $(mslField).parent().hide();
|
||||||
|
// })
|
||||||
|
|
||||||
|
$('#field-no_of_attendees').on('change',function(){
|
||||||
|
let qtyValue=parseInt($(this).val());
|
||||||
|
$('#doctor_msl_wrapper').html('')
|
||||||
|
for(let i = 1; i <= qtyValue; i++) {
|
||||||
|
$('#doctor_msl_wrapper').append(`<div class="col-md-12 mb-2">
|
||||||
|
<label for="field-conact_id_${i}" class="form-label">HCP Name ${i}<span class="text-danger">*</span> </label>
|
||||||
|
<input type="text" id="field-contact_id_${i}" name="contact_id[]" class="form-control" value="" required>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-12 mb-2">
|
||||||
|
<label for="field-legacy_code_${i}" class="form-label">P Code ${i}<span class="text-danger">*</span> </label>
|
||||||
|
<input type="text" id="field-legacy_code_${i}" name="legacy_code[]" class="form-control" value="" required>
|
||||||
|
</div>`)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
function hideDoctorFields (){
|
||||||
|
docNameFields.forEach((docField, index) => {
|
||||||
|
if(index !== 0)
|
||||||
|
$(docField).parent().hide();
|
||||||
|
$(docField).prop({"required":false});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//hide msl code fields
|
||||||
|
function hideMSLCodeFields (){
|
||||||
|
mslCodeFields.forEach((mslField, index) => {
|
||||||
|
if(index !== 0)
|
||||||
|
$(mslField).parent().hide();
|
||||||
|
$(mslField).prop({"required":false});
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//show doctor fields
|
||||||
|
function showDoctorFields (numOfFields){
|
||||||
|
docNameFields.forEach((docField, index) => {
|
||||||
|
if(index < numOfFields)
|
||||||
|
$(docField).parent().show();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//show msl code fields
|
||||||
|
function showMSLCodeFields (numOfFields){
|
||||||
|
mslCodeFields.forEach((mslField, index) => {
|
||||||
|
if(index < numOfFields)
|
||||||
|
$(mslField).parent().show();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
$('#report-form').on('submit', function(event){
|
$('#report-form').on('submit', function(event){
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
$("#pageloader").fadeIn();
|
$("#pageloader").fadeIn();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue