Forums

Email Template - dollarsign messes field output

wizdum 03 Sep, 2008
Cronoforms 2.5

I have a field that takes a dollar amount.
It is stored in the 'saved data' table correctly.
However it does not come out correctly in the email template.

ie,
$50000 comes out as 000
$50,000 comes out as ,000
$50000.00 comes out as ,000.00

Can anyone tell me where in the code to look to fix this?
Max_admin 03 Sep, 2008
Hi wizdum,

you are using the template or the elements titles ? you should find both at chronocontact.php but I want to know more about the issue!

Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
wizdum 03 Sep, 2008
Hi Max. I am using the email template.
outputting the field in html eg <td>{ReqBaseSalary}</td>

I checked the html source and the dollarsign and first two digits are missing if a dollarsign is included.
wizdum 03 Sep, 2008
I see now where its processed but have no idea what the problem is :?
foreach ( $fields as $name => $post) {
	$html_message = preg_replace("/\\{".$name."\\}/", $post, $html_message);
}


if i echo $post when $name == ReqBaseSalary it is correct. However if i echo $html_message after it is subsituted, it is missing the characters.
Max_admin 03 Sep, 2008
ok, try to add the field value as \$50000, backslash before it, what happens ?
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
wizdum 03 Sep, 2008
Yeah that works.
it seems $n in preg_replace() outputs subpatterns of the regex

I changed it to str_replace and its all good🙂
$html_message = str_replace('{'.$name.'}', $post, $html_message);
Max_admin 03 Sep, 2008
great, thanks for letting me know this!😉
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
kflorida 13 Jan, 2009
Wizdum,

could you please expand on how you fixed this or post the source code for chronoform.php?

I tried changing "preg" to "str" and it broke it.

Thanks, I'm very new at this..
Max_admin 13 Jan, 2009
Hi, try mine:

[attachment=0]chronocontact.zip[/attachment]

Cheers
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
This topic is locked and no more replies can be posted.