Hi!
I recently started using Joomla 1.5.8 and now also ChronoForms (latest component), which so far works like a dream. What I am trying to do is to make a simple contact form where the user can select from a list of radio-buttons of three people to contact, and then the email will go to that person.
Here is an excerpt of the form code I am using:
And in the "On Submit code - before sending email" box:
The to-email in the emailsetup is currently set to a static one, does this make any difference as far as the above code is concerned (as opposed to a dynamic one)? I have been looking through many possible solutions for this, but I haven't been able to get it working yet. Maybe a small error on my part?
I recently started using Joomla 1.5.8 and now also ChronoForms (latest component), which so far works like a dream. What I am trying to do is to make a simple contact form where the user can select from a list of radio-buttons of three people to contact, and then the email will go to that person.
Here is an excerpt of the form code I am using:
<DIV class="form_item">
<DIV class="form_element cf_radiobutton">
<LABEL class="cf_label">Kontaktperson</LABEL><DIV class="float_left">
<INPUT name="kontakt" value="box1" id="box1" class="radio" class="radio validate-one-required" type="radio"><LABEL class="radio_label" for="kontakt">person1</LABEL><BR>
<INPUT name="kontakt" value="box2" id="box2" class="radio" type="radio"><LABEL class="radio_label" for="kontakt">person2</LABEL><BR>
<INPUT name="kontakt" value="box3" id="box3" class="radio" type="radio"><LABEL class="radio_label" for="kontakt">person3</LABEL><BR>
</DIV></DIV>
And in the "On Submit code - before sending email" box:
<?php
if(JRequest::getVar('box1'))$emails[0]->to .= ',email1@domain.com';
if(JRequest::getVar('box2'))$emails[0]->to .= ',email2@domain.com';
if(JRequest::getVar('box3'))$emails[0]->to .= ',email3@domain.com';
?>
The to-email in the emailsetup is currently set to a static one, does this make any difference as far as the above code is concerned (as opposed to a dynamic one)? I have been looking through many possible solutions for this, but I haven't been able to get it working yet. Maybe a small error on my part?