Hello all! I am having an issue with setting up a form where the user can select from a dropdown menu the purpose of the email, and based on that selection, the form will direct the message to the appropriate email. Below is the sample code for the form that I created:
[code]
<label>First Name: </label>
<input name="fname" type="text" id="fname" class="textField1"/>
</p>
<p>
<label>Last Name: </label>
<input name="lname" type="text" id="lname" class="textField1" />
</p>
<p>
<label>Your Email: </label>
<input name="email" type="text" id="email" class="textField1" />
</p>
<p>
<label>Phone Number: </label>
<input name="phone" type="text" id="phone" class="textField1"/>
</p>
<p>
<label>Purpose of the Message: </label>
<select name="recipient" id="recipient" class="textField1" >
<option selected="selected">Please Select</option>
<option value="email1@domain.com">Selection1</option>
<option value="email2@domain.com">Selection2</option>
<option value="email3@domain.com">Selection3</option>
<option value="email4@domain.com">Selection4</option>
<option value="email5@domain.com">Selection5</option>
</select>
</p>
<p>
<label>Message: </label>
<textarea name="message" id="message" class="textField2"></textarea>
</p>
<p>
<label>
put "recipient" in the special fields tab, email field field!
Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hey Max, thanks for the reply. I have that field filled in as well with recipient, but still doesn't work. Any other suggestions?
GREAT! Thank you for the help Bob! That PHP line of code did the trick.
Thank! :woohoo:
I'm interested in this solution as well but the link is no longer working ... any help?
check FAQ #31 from the list we have now!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Good stuff! The only problem I have now is that the form doesn't seem to be emailing ....?
Hi kdesilva ,
What do you see in the DeBug display?
Bob
Here are the results from the debug:
* Form passed first SPAM check OK
* Form passed the submissions limit (if enabled) OK
* Form passed the Image verification (if enabled) OK
* Form passed the server side validation (if enabled) OK
* Form passed the plugins step (if enabled) OK
* Emails data loaded OK
* Form passed all before email code evaluation OK
* Debug End
_POST: Array ( [text_0] => Kevin [text_1] => 2222 [select_2] => Civil & Structural Engineering [text_3] => sss [undefined] => Submit [c1a12197664e7f080607c2c778e9c6d6] => 1 )
I don't know where to go from here...
Hi kdesilva,
Nope, 'fraid not. Either Max has changed the debug or something is killing the code before it gets to the point of sending the email. I'm not sure which.
Bob
Hi Bob,
Yes, Debug code was changed alittle!🙂
@kdesilva, the new V3.0 is alittle different, lets start from the beginning, do you have any emails setup and enabled ? you should see how many emails are enabled/disabled in front of every form at the forms management page!
let me know!
Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This is what I have for the form:
Enabled:0
Disabled:0
Is that what you mean? I have "email the results" set to "yes"
I don't have anything under the tab "setup emails" however .. I wanted to use the dynamic method of the drop down like what was suggested in FAQ 31
ok, first add some email, refer to the setup emails tutorial at the downloads > chronoforms tutorials, after you add an email and test it success let me know and I can show you the V3.0 way, its in another recent topic here! will try to find it!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
ok, reading now - is this going to affect the multiple email listing I already set up?
Ok done that and tried out .. no email yet ..
by the way .. do you notice the captcha is a bit buggy in firefox? Sometimes it says I've typed in the wrong code, then I try it again a couple times and it works ..
That's for a different topic though ... no email through yet..
Did you add any code of that post yet ? you need to see at least Enabled:1 in the forms management, does this happen ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
yeah I've added that code the post talked about ...
and I do have enabled: 1
please remove any code and test receiving normal email as I mentioned in my earlier post, we must make sure your site emails!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
so how do I get it to work the way I want with the php code now?
Hi, your code should be :
<?php
$emailslist = array('em1'=>'info@vertigo.bm', 'em2'=>'info@vertigo.bm', 'em3'=>'info@vertigo.bm', 'em4'=>'info@vertigo.bm', 'em5'=>'info@vertigo.bm');
$emails[0]->to = $emailslist[$_POST['recipients']];
?>
assuming your dropdown name is
recipientsCheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Your onsubmit code is wrong, please check my last post above how the onsubmit code looks, it should go on the onsubmit before email box!
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hi Max!
But now the Email goes out to:
To: [email]info@example.com[/email], em2
Do you know a way to remove the "em2" from the recipients?
Which Chronoforms version do you have ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.