Hi,
I tried to search on the internet but I did not find a solution to my problem.
I do not know if this is possible, I try to retrieve the input value found only in my custom code, in order to send their data in the body of an email.
For example in my custom code I created a input which id is "totalPrice", can I get this value for send it by email.
I tried with {input_name} but It's work only for input created with Chronoform it seems not working if the input is in custom code.
Thank you.
Hi Undisclosed ,
You have to add the value to the $form->data array as e.g. $form->data['totalPrice'] - then you can use it in the email.
Bob
Hello,
I tried your solution but it does not work in my case since when I write $ form-> data ['totalPrice'] it tries to go in the array to the index totalPrice or this one does not exist because it is only defined and managed in my custom code. So I get a php error undefined index totalPrice.
That is my problem so I wish to know if it possible to recover the value of an input totally created and managed in custom Code to add his value in $form->data so that it can be sent by mail later.
I also tried to create a hidden input in the designer with id "totalPrice" so that it could contain my value and that I could send it by mail but the problem remains the same I no longer have the error undefined index totalPrice, but I can not get the value of my input in my custom code to reinject it into the hidden input.
I'm sending you a screenshot so you can better understand. The value of the input that I want to recover is in the custom code which is in the on load event. So that is possible to recover a value of input which only is in the custom code for send it by email?
Thanks you
Hi,
If the field name is "test" and the field code is placed inside the "form" tags then it should be possible to get its value using "{test}.
I suggest testing with the new v6, you can install it with v5 on the same website.
Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hi Undisclosed ,
There was no screenshot attached,
You need to set the value of $form->data['totalPrice'] in your custom code - you can then use it in other form actions.
Bob
Hi,
I tried your different proposals but without success. My problem remains the same.
Here you can see my custom code in the on load event in the screenshot.
And in this custom code I have a form which contain my input field named prixTotal :
<form>
<label for="depart">Envoi à partir de </label>
<select name="depart" id="depart" onChange="calculerAll()">
<option value="depIdf">Départements IDF</option>
<option value="depLimitrophe">Départements Limitrophes IDF</option>
<option value="province">Province</option>
</select>
Prix total : <input id = "prixTotal" name = "prixTotal" type="text" readonly = "readonly" /> €
</form>
Then depending on the choices that the user make I change the value of this field.
So the final value is when the user click on button « Envoyer » (his type is submit), which will send the form.
You can see in the other screenshot the designer menu.
But when I use debugger my $form data contain only my field defined in Designer like $form->data[‘email’], price etc … He contains nothing fields of my custom code. So how can I get the value of my input field ‘prixTotal’ defined in my custom code, for insert it in my hidden field. It should be :
$form -> data[‘price’] = $value_of_my_input_field ;
Thank you.
Hi,
Please use your code inside a "custom" element under the "Designer", and remove the "form" tags in your code, the way you have it now is like having 2 forms.
Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.