templates/registration/registration_student/_js.html.twig line 1

Open in your IDE?
  1. <script>
  2.     function submitTarget(){
  3.         if($('#registration_student_pre_registration_last_school_attended').val() == ''){
  4.             $('#registration_student_pre_registration_last_school_attended').focus();
  5.             return false;
  6.         }
  7.         if($('#registration_student_pre_registration_registration_number').val() == ''){
  8.             $('#registration_student_pre_registration_registration_number').focus();
  9.             return false;
  10.         }
  11.         if($('#registration_student_pre_registration_last_name').val() == ''){
  12.             $('#registration_student_pre_registration_last_name').focus();
  13.             return false;
  14.         }
  15.         if($('#registration_student_pre_registration_first_name').val() == ''){
  16.             $('#registration_student_pre_registration_first_name').focus();
  17.             return false;
  18.         }
  19.         if($('#registration_student_pre_registration_birthday').val() == ''){
  20.             $('#registration_student_pre_registration_birthday').focus();
  21.             return false;
  22.         }
  23.         $('#target').submit();
  24.     }
  25.     $(document).ready(function () {
  26.         $('#otherResponsible').hide();
  27.         $('#registration_student_pre_registration_is_parntal_authority_father').val("1");
  28.         $('#registration_student_pre_registration_is_parntal_authority_mother').val("0");
  29.         $('#registration_student_pre_registration_responsible_of_schooling').on('change', function(){
  30.             if($('#registration_student_pre_registration_responsible_of_schooling').val() == 'AUTRE'){
  31.                 $('#otherResponsible').show();
  32.                 $('#registration_student_pre_registration_responsible_of_schooling_last_name').prop('required', 'true');
  33.                 $('#registration_student_pre_registration_responsible_of_schooling_first_name').prop('required', 'true');
  34.                 $('#registration_student_pre_registration_responsible_of_schooling_address').prop('required', 'true');
  35.                 $('#registration_student_pre_registration_responsible_of_schooling_phone_number').prop('required', 'true');
  36.                 $('#registration_student_pre_registration_responsible_of_schooling_post').prop('required', 'true');
  37.                 $('#registration_student_pre_registration_responsible_of_schooling_location').prop('required', 'true');
  38.             }else{
  39.                 $('#otherResponsible').hide();
  40.                 $('#registration_student_pre_registration_responsible_of_schooling_last_name').prop('required', 'false');
  41.                 $('#registration_student_pre_registration_responsible_of_schooling_first_name').prop('required', 'false');
  42.                 $('#registration_student_pre_registration_responsible_of_schooling_address').prop('required', 'false');
  43.                 $('#registration_student_pre_registration_responsible_of_schooling_phone_number').prop('required', 'false');
  44.                 $('#registration_student_pre_registration_responsible_of_schooling_post').prop('required', 'false');
  45.                 $('#registration_student_pre_registration_responsible_of_schooling_location').prop('required', 'false');
  46.             }
  47.         })
  48.         $('#registration_student_pre_registration_is_parntal_authority_father').on('change', function(){
  49.             if($('#registration_student_pre_registration_is_parntal_authority_father').val() == "1"){
  50.                 $('#registration_student_pre_registration_is_parntal_authority_mother').val("0");
  51.             }else{
  52.                 $('#registration_student_pre_registration_is_parntal_authority_mother').val("1");
  53.             }
  54.         })
  55.         $('#registration_student_pre_registration_is_parntal_authority_mother').on('change', function(){
  56.             if($('#registration_student_pre_registration_is_parntal_authority_mother').val() == "1"){
  57.                 $('#registration_student_pre_registration_is_parntal_authority_father').val("0");
  58.             }else{
  59.                 $('#registration_student_pre_registration_is_parntal_authority_father').val("1");
  60.             }
  61.         })
  62.     })
  63. </script>