PDA

View Full Version : Only attach encoded data if fields were filled in?



liquidlight
03-May-2006, 01:19 AM
:D me again...
After I got everything working and have got a nice looking html email arriving in my account with the unencrypted field data and an attachment with the encrypted credit card details, there is only one more question:

In order to tell me at a glance if people have filled in the credit card details (it is an optional part of the form only required to confirm bookings), is there a way to only encrypt and send the attachment when the fields have been filled in and ignore them if they haven't?

If there is than that would be the ultimately user friendly version of the form I created. It would tell my client instantly that if there is an encrypted attachment, the person that filled in the form has provided credit card details. If there is no attachment, they have not. That would cut out the need to decrypt every attachment just to find it has no details in it.

You have been extremely helpful, answering all my (sometimes stupid) questions and I am grateful for all the info you gave me along the way. My client is very happy with the form.


*** THANK YOU ***
:)

russellr
03-May-2006, 01:34 AM
Hi,

Yes, this should be possible.

I'll need to look at your form to give you specific advice. Please post or pm the URL to the form.

liquidlight
03-May-2006, 07:24 AM
Cheers for your fast response :)
The url for the form is: https://goblin.hosts.net.nz/havenz.co.nz/enquiry.htm

Thank you,
Merle

russellr
03-May-2006, 09:11 PM
Hi,

There are a number of ways of going about this.

The simplest way is to create a radio button field (probably positioned above the "Card Type" field) that the user chooses between entering credit card details or not.

Like this:


<tr>
<td height="19" class="form_txt"><div align="left">Please select:</div></td>
<td><p align="left">
I am providing my credit card details below: <input type="radio" name="filter" value="encode" />&nbsp;
I am making a general enquiry (or paying by cash): <input type="radio" name="filter" value="" checked />
</p></td>
</tr>


So, instead of a "hidden" field called "filter" which always specifies encryption (encode), you're creating a radio button that the user selects and this controls whether encryption takes place or not.

Remember to remove your "hidden" field called "filter" (near the top).

Using JavaScript, you can also use this radio button field (called "filter") to control whether the credit card details fields are enabled or not (so the user can only enter credit card details if they say they are going to).

Also, you can use "conditions" to make the credit card details required and not required depending on the setting of the "filter" field.

The two other ways to this are:

Use a multi-page form. The second page is shown when the radio button is selected to a particular value. The second page collects the credit card details.
Use the new FormMail Computation Module (requires purchase) to generate the "filter" field based on the answers the user provide to the credit card fields (this means you don't need the radio button).