Hi,
I'm using Joomla 2.5 and Chronoforms.
I have created a form where users insert some fields and select some options from a Select dropdown.
My problem is that I would send a mail with option text selected in the dropdown but chronoforms send to me the value of the option.
How can I send by email the text of my option?
I tried this code:
where select_1 is my select and desc_select1 is a text field hidden.
But dosen't works. why?
Regards
monak83
I'm using Joomla 2.5 and Chronoforms.
I have created a form where users insert some fields and select some options from a Select dropdown.
My problem is that I would send a mail with option text selected in the dropdown but chronoforms send to me the value of the option.
How can I send by email the text of my option?
I tried this code:
window.addEvent('domready', function(){
$('select_1').addEvent('change', function(){
this.getChildren().each(function(o){
if (o.selected == true) {
$('desc_select1').value = o.getText();
var test=form.elemetns['desc_select1'].value;
alert(test)
}
});
});
});
where select_1 is my select and desc_select1 is a text field hidden.
But dosen't works. why?
Regards
monak83
Hi monak83,
You could set up the options so that the text and the value are the same. Or I usually use a little code on the On Submit event to look up the text equivalent of any values I need to display.
You could modify your code to write the text to a hidden input but it's probably not worth the effort involved.
Bob
You could set up the options so that the text and the value are the same. Or I usually use a little code on the On Submit event to look up the text equivalent of any values I need to display.
You could modify your code to write the text to a hidden input but it's probably not worth the effort involved.
Bob
I can't use values equal to text because ibuse these the make some calculus.
I can i do to have on the email the text of dropdown selected?
I can i do to have on the email the text of dropdown selected?
Hi monak83,
Use a little PHP in a Custom Code action in the On Submit event to look up the text equivalent of any values.
Bob
Use a little PHP in a Custom Code action in the On Submit event to look up the text equivalent of any values.
Bob
can you post an example of this code?
I attach my select:
I attach my select:
<select style="width:auto;" id="selec_1" size="1" class=" validate['required']" title="" container_id="0" name="banner" onchange="aggiorna_form(this.form)">
<option value="0" selected="selected">Seleziona un Banner</option>
<option value="1">TOP Categoria 3 mesi €69</option>
<option value="2">TOP Categoria 6 mesi €99</option>
<option value="3">TOP Categoria 12 mesi €149</option>
<option value="4">TOP Home+Categoria 3 mesi €99</option>
<option value="5">TOP Home+Categoria 6 mesi €149</option>
<option value="6">TOP Home+Categoria 12 mesi €199</option>
</select>
Hi Bob I try you code found here: http://www.chronoengine.com/forums/viewtopic.php?f=2&t=22548
But dosen't works...I'm under Joomla 2.5.
But dosen't works...I'm under Joomla 2.5.
Hi monak83,
Please try:
Bob
Please try:
<?php
$banner_price_list = array(
1 => 69,
2 => 99,
3 => 149,
4 => 99,
5 => 149,
6 => 199
);
$form->data['banner_price'] = $banner_price_list[$form->data['banner']];
?>
And then {banner_price} in the email template.Bob
Ok, upon trying to input a custom element with that code I get the following php error:
The code I'm trying to use is:
Is there any significant problems with it that you can see?
Parse error: syntax error, unexpected T_DNUMBER, expecting ')' in /home/museum/public_html/administrator/components/com_chronoforms/form_actions/show_html/cfaction_show_html.php(124) : eval()'d code on line 57
The code I'm trying to use is:
<?php
$banner_price_list = array(
Individual 50.00 => 50.00,
Family 75.00 => 75.00,
Smithsonian Sustainer 150.00 => 150.00,
Contributor 250.00 => 250.00,
Patron 500.00 => 500.00,
1892 Club 1000.00 => 1000.00,
Senior 30.00 => 30.00,
Military 30.00 => 30.00,
Educator 30.00 => 30.00,
Artist 30.00 => 30.00,
Dual Senior 60.00 => 60.00
);
$form->data['banner_price'] = $banner_price_list[$form->data['banner']];
?>
Is there any significant problems with it that you can see?
It's an old post, but someone could use the solution.
Solution is in the FAQs list
http://www.chronoengine.com/faqs/3222-how-can-i-get-useful-data-from-select-drop-downs-checkboxes-and-radio-buttons.html
With some changes:
- If you have special characters (@ or .) you need to put them like string with quotation.
'some value @something.com' => 'some data',
<?php
$banner_price_list = array(
'Individual 50.00' => '50.00',
Solution is in the FAQs list
http://www.chronoengine.com/faqs/3222-how-can-i-get-useful-data-from-select-drop-downs-checkboxes-and-radio-buttons.html
With some changes:
- If you have special characters (@ or .) you need to put them like string with quotation.
'some value @something.com' => 'some data',
<?php
$banner_price_list = array(
'Individual 50.00' => '50.00',
This topic is locked and no more replies can be posted.