I would appreciate any help with my problem which is..
..having set up a form with text box the emails received do not have carriage returns often making the text very difficult to read. I have tried different wrap commands but this makes no difference. I have read elsewhere on the forum that ChronoForms use unformatted HTML so will not pass carriage returns. If this is the case is there any other way of getting around the problem?
Hi Thrushwood,
try to switch the email type to "plain text" in the "Email properties" area ?
Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Thanks for the response but where can I find the "email properties" area?
For your information I am using ChronoForms V2.3.9 J1.0
then this is another scenario, try to put this code in the onsubmit before email :
<?php
$_POST['fieldname'] = nl2br($_POST['fieldname']);
?>
replace fieldname with the real textbox name!
Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hi Max,
Tried adding the code you suggested, replacing the field name, but still no carriage returns are present in the email.
Is there any thing else you can suggest?
Regards,
Paul S.
hi Paul,
try :
<?php
$_POST['fieldname'] = str_replace("\n", "<br>", $_POST['fieldname']);
?>
?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hi Max,
I've tried the new line of code and its the same problem.
Regards,
Paul
try this:
<?php
$_POST['fieldname'] = str_replace(array(chr(10), chr(13)), "<br>", $_POST['fieldname']);
?>
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hi Max,
Sorry but the new piece of code still hasn't cured the problem.
Regards,
Paul
Hi Paul,
ok, lets test something, add my code above to the onsubmit after email box and add before it "echo " so you can see the output, what do you get ?
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hi Max,
You are going to have to be patient with me here because I don't know php code so if I add the code, with echo in front where do I see the output? I have tried adding it to the 'On Submit code - after sending email' (your previous replies mentioned adding to the on submit before email) and then submitting a completed form which returns by email but is no different. At the moment other than adding the code you suggest the on submit code before and after fields are empty, just the html and email fields having the html code in them. I guess I am not doing something right - could you spell it out for me?
Thanks,
Paul
Hi Paul,
add the echo before the first $_POST word and leave a space between them!
Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hi Max,
Ok - added echo with space as mentioned, sent form and received email which is still the same. Where should I expect to see the output from the echo command?
Regards,
Paul
Hi Paul,
the output should appear just after the submit at your site, like a "thank you message", do you have a redirect URL ? if so then please remove it temporarily to see the message!
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hi Max,
The image shows the output on submit.
Regards,
Paul
and what did you add to the textbox to get this result ? why its showing the line 3 times!! ?
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hi Max
I entered into the text box..
"Single line of text and 2 carriages returns"
..3 times.
The output showed it just as I entered it, the single line of text on 3 separate lines.
The email collapses it to a continuous line of text with just a space between each line.
regards,
Paul
cool, so it works fine after the form submit but not in the email ? do you have this code in the onsubmit "before" email or "after" email ? make it "before" please and 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.
OK Max, when I came to move the code from the submit after to submit before email I found that I had left one of the earlier pieces of code you suggested in there! Once that code had been replaced the echo output showed the entered text but without the error message that was outputted previously. However the email still came through with the text collapsed to one line. Does this mean it is likely to be a email/server/hosting issue?
No I don't think so, it may be a line of code which removed the HTML after we added it, lets try this, at your textbox, after each line, add <br> , what do you get in the email ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hi Max,
As you thought adding <br> to the form text does separate the lines in the email.
Regards,
Paul
This is really puzzling now, I thought it will not because the html tags are getting filtered, but it looks like no, and you are sure that the code we used before was in the "onsubmit BEFORE email" box ? if so then I need t check this myself, please send me a temporarily admin login through the PM
Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hi Max,
Just checking you get my PM as requested.
Regards,
Paul
Hi Paul,
yes I got it, but was very busy with the new version, will check it today!
regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
I fixed it using the same code in the email template!
Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hi Max,
Thanks very much for your help - and patience!
Best regards,
Paul
What's the solution to this problem???
Could you help me? I have the textarea to get address, so it's interesting that I receive the email with newline...
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.