I'm building a form for an organisation that organises a workshop for teenagers. There is an option to bring one or both parents to the workshop. So for each parent, there's a dropbox to answer the question "Will you participate in the workshop as well?" Depending if one, both or no parents will join, the user will be redirected to a different url after submiting (submit is always in the same place). The form is built with chronoforms in Joomla.
This is the code for the dropdowns, please note that I can't change the values "Ja" or "Nee" because this value is also sent to a database and i'm not allowed to change it. Code for the dropdowns:
Now I need the On Submit code after sending mail, this is my try at it, but it doesn't work, so...:
I have some knowledge in php, but les sin chronoforms. What am I doing wrong? Doesn't it recognize $form? Important: the website uses Chronoforms 3.1
This is the code for the dropdowns, please note that I can't change the values "Ja" or "Nee" because this value is also sent to a database and i'm not allowed to change it. Code for the dropdowns:
<select class="cf_inputbox validate-selection required" id="select_17" size="1" title="verplicht veld" name="oudersessieouder1" style="width: 193px;">
<option value="">Make your choice</option>
<option value="Ja">Yes, will participate</option>
<option value="Nee">No, will not participate</option>
</select><label class="cf_label" style="width: 150px;"> Will this parent join the workshop?</label>
<select class="cf_inputbox validate-selection required" id="select_18" size="1" title="verplicht veld" name="oudersessieouder2" style="width: 193px;">
<option value="">Make your choice</option>
<option value="Ja">Yes, will participate</option>
<option value="Nee">No, will not participate</option>
</select><label class="cf_label" style="width: 150px;"> Will this parent join the workshop?</label>
Now I need the On Submit code after sending mail, this is my try at it, but it doesn't work, so...:
<?php
if ( $form->data['oudersessieouder1'] == 'ja' && $form->data['oudersessieouder2'] == 'ja' ) {
$form->data['redirect_url'] = JUri::root().'inschrijven-pe-jongeren-both-parents.html';
} elseif ( $form->data['oudersessieouder1'] == 'ja' || $form->data['oudersessieouder2'] == 'ja' ) {
$form->data['redirect_url'] = JUri::root().'inschrijven-pe-jongeren-1-parent.html';
} else {
$form->data['redirect_url'] = JUri::root().'inschrijven-pe-jongeren.html';
}
?>
I have some knowledge in php, but les sin chronoforms. What am I doing wrong? Doesn't it recognize $form? Important: the website uses Chronoforms 3.1