• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Do not store form data to database

Do not store form data to database 10 years 2 months ago #30467

Hi,

I have a hidden field that I set to an email address depending on the 'pay_by' radio button selection using the script below that is triggered when the form is submitted. I then use the {mail_treasurer:value} placeholder in the to field of an additional email so send, or not send, an email to our treasurer. Which works a treat.

My question is - Is there a way I can stop this hidden field from being stored on the database?

onclick="if (document.getElementById('pay_by0').checked)
{
document.getElementById('mail_treasurer').value=' This e-mail address is being protected from spambots. You need JavaScript enabled to view it ';
}"
The administrator has disabled public write access.

Do not store form data to database 10 years 2 months ago #30479

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

You can try the following approach instead:

- remove the hidden field and your JavaScript.

- configure your additional email as you desire, including the "To" email being " This e-mail address is being protected from spambots. You need JavaScript enabled to view it ".

- navigate to backend > Components > RSForm!Pro > Manage Forms > your form > Properties > PHP Email Scripts > Script called before the Additional Emails are sent. Here you can add (replace accordingly):
if ($_POST['form']['my-radio-group-name'] != 'radio-exact-choice'){
$additionalEmail['to'] = '';
}

If the radio group does not have that particular choice when the form is submitted, it will clear the TO field of the additional email, thus no longer sending it.
This is not official customer support. To receive your support, submit a support ticket here.
The administrator has disabled public write access.
The following user(s) said Thank You: greenpole

Do not store form data to database 10 years 2 months ago #30482

That's a far better way to do it.
Thank you.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!