FORMfields, the premiere web framework
Login
Support Home | Knowledge Base | Documentation | Forums | Contact Us
Info
FORMfields & FORMgen :: Generated Forms

Hide Field From Email But Not Database

(1746 views. Last Updated: 2009-08-27 3:20 PM)

Here is how to hide a field value from being sent in an email, while still allowing it to be stored in your database. Simply edit your form and wrap the FfForm::email() call in setData() calls. For example, if the target field is named "my_field" replace:
$ffForm->email($formEmail1To, $formEmail1Subject, $formEmail1From,
         $formEmail1Cc, $formEmail1Bcc, $formEmail1MsgHeader,
         $formEmail1MsgFooter, $formEmail1Attachments, $formEmail1UseHtml,
         $formEmail1CssFile, $formEmail1SendFormData, $formEmail1SendFormUploads);
with:
$ffForm->formFields["my_field"]->setData(false);
$ffForm->email($formEmail1To, $formEmail1Subject, $formEmail1From,
         $formEmail1Cc, $formEmail1Bcc, $formEmail1MsgHeader,
         $formEmail1MsgFooter, $formEmail1Attachments, $formEmail1UseHtml,
         $formEmail1CssFile, $formEmail1SendFormData, $formEmail1SendFormUploads);
$ffForm->formFields["my_field"]->setData(true);
Info
Support | Earn Money
Copyright © 2005-2019 Brain Book Software LLC.
Built with FORMfields, the premiere web framework.