Forums

Multiply a number in my submission when emailing

DrSmith69 17 Sep, 2017
Hi Guys,

I am having some difficulty figuring out how to do the below:

I have a form where i need someone to enter an amount lets say 1000, when they submit the results I have an email which calls on the data in the field and sends this to the user, but I need the 1000 to be multiplied by 10 and send as 10000?

I hope that makes sense, I see there is some multiplication sections in the events on the text field - how can I do this?
GreyHead 17 Sep, 2017
Hi DrSmith69,

I would probably do that with Custom Code and use PHP to do the multiplication before the email is sent.

Bob
DrSmith69 18 Sep, 2017
Thanks GreyHead,

I have come across the section 'Modify Data' where you can Data Override,

Would this also work? What is the format this section uses?
GreyHead 18 Sep, 2017
Hi DrSmith69,

It doesn't look to me as if the Modify Data action supports calculations.

Bob
Max_admin 20 Sep, 2017
Answer
Hi,

You will need a PHP action before the email action with this:

$this->data["field_name] = 10 * (int)$this->data["field_name];


Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
DrSmith69 20 Sep, 2017
1 Likes
Hi Max,

It works like an absolute charm!!!! Thank you
This topic is locked and no more replies can be posted.