diff options
author | Sashi20 | 2023-01-02 13:29:30 +0530 |
---|---|---|
committer | Sashi20 | 2023-01-02 13:29:30 +0530 |
commit | 82d124d177ae35da90fab83c48660d798bdf0858 (patch) | |
tree | 974128ab37f2bee985a58cb1bfd9b8eb882521b5 | |
parent | 63fa920fa6297f7ea19bc76ab4aa73bfdc03892c (diff) | |
download | fellowship_testimonials-82d124d177ae35da90fab83c48660d798bdf0858.tar.gz fellowship_testimonials-82d124d177ae35da90fab83c48660d798bdf0858.tar.bz2 fellowship_testimonials-82d124d177ae35da90fab83c48660d798bdf0858.zip |
Allow registration once per participant
-rw-r--r-- | vle_registration.inc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/vle_registration.inc b/vle_registration.inc index e59886e..6bf5618 100644 --- a/vle_registration.inc +++ b/vle_registration.inc @@ -337,6 +337,19 @@ function ajax_get_district_list_callback($form, $form_state) function animation_hackathon_vle_registration_form_validate($form, &$form_state) { $v = $form_state['values']['team_member_2']; + $team_lead_email = $form_state['values']['team_member_1']['email']; + $query = db_select('animation_hackathon_vle_registration'); + $query->fields('animation_hackathon_vle_registration'); + $query->condition('team_member_1_email', $team_lead_email); + $result = $query->execute(); + $row = $result->fetchObject(); + if($row){ + drupal_set_message('You have already registered', 'error'); + drupal_goto('animation-hackathon/vle-registration'); + } + /*if (!valid_email_address($form_state['values']['team_member_1']['mail'])) { + form_set_error('submitted][email_address', t('The email address appears to be invalid.')); +}*/ if($form_state['values']['team_size'] == 'Yes'){ if($v['name'] == '') form_set_error('team_member_2][name', 'Enter name of team member 2'); @@ -350,6 +363,9 @@ function animation_hackathon_vle_registration_form_validate($form, &$form_state) form_set_error('team_member_2][category', 'Enter category of team member 2'); if($v['institution'] == '') form_set_error('team_member_2][institution', 'Enter institution id of team member 2'); + /*else if (!valid_email_address($v['email'])) { + form_set_error('team_member_2][email', 'The email address appears to be invalid.'); + }*/ } } |