Team 3 (Revesmart Launch Drive (Neb 2)
This commit is contained in:
parent
58df87f186
commit
44a3b9584d
|
|
@ -334,10 +334,30 @@
|
|||
}
|
||||
|
||||
})
|
||||
|
||||
$('#field-no_of_boxes_given').parent().hide();
|
||||
$('#field-no_of_boxes_given').attr('required',false);
|
||||
|
||||
|
||||
$('#field-sample_given_to_doctor').on('change',function(){
|
||||
let value=$(this).val();
|
||||
if(value==='Yes'){
|
||||
$('#field-no_of_boxes_given').parent().show();
|
||||
$('#field-no_of_boxes_given').attr('required',true);
|
||||
}
|
||||
else{
|
||||
$('#field-no_of_boxes_given').parent().hide();
|
||||
$('#field-no_of_boxes_given').attr('required',false);
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
$('#report-form').on('submit', function(event){
|
||||
event.preventDefault();
|
||||
if($('#field-sample_given_to_doctor').val()==='Yes'){
|
||||
$('#report-form').append("<input type='hidden' name='sample_given' value='1' />");
|
||||
}
|
||||
$('#report-form').append('<input type="hidden" name="num_of_boxes" value="'+$('#field-no_of_boxes_given').val()+ '" />');
|
||||
const formData = new FormData($('#report-form')[0]);
|
||||
// Log form data to console
|
||||
for (let [key, value] of formData.entries()) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue