Forums

[resolved] I would hide in email form fields not filled

ask 12 Feb, 2011
Hello everyone,

I created a form with some fields are optional, and send a template email.
I would hide in email form fields not filled in, so you do not see anything in email
{something}
.
is it possible?

Thanks in advance for your time.
Alex

ps: sorry for my English (translated by google) :-)
GreyHead 12 Feb, 2011
Hi ask,

In the OnSubmit Before Email box add this code:
<?php
$something = JRequest::getString('something', '', 'post');
JRequest::setVar('something', $something);
?>
This will replace {something} with '' (an empty string).

This is usually Ok for a simple form. For a form with many inputs or repeatign inputs there's a much fuller more complex solution here.

Bob
ask 12 Feb, 2011
Hi Bob,

Great! Is just what I wanted!
thanks for everything:)

Alex
This topic is locked and no more replies can be posted.