close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Modify what fields form emails

Thread began 1/20/2011 7:15 am by Sally | Last modified 7/07/2011 7:34 am by Jason Byrnes | 2352 views | 7 replies |

Sally

Modify what fields form emails

My form emails include several fields I don't want - such as "Hidden Field:" and "SimpleContact submit:"

Looking at the code on the template it says <?php echo(str_replace("_"," ",$pkey)); ?> which doesn't help me in removing only particular items.

Where can I modify that and can I use the field names given on the email when I do it?

Thank you.

Sign in to reply to this post

Jason ByrnesWebAssist

in the email template file, there should be the following code at the top:

php:
<?php

$remove 
= array();
$remove[]  = "";
$remove[]  = "x";
$remove[]  = "y";

$removeBegins = array();
$removeBegins[] = "Security";

$removeEnds = array();
$removeEnds[] = "_x";
$removeEnds[] = "_y";

$removeIncludes = array();
$removeIncludes[] = "Security";
?>



this creates three arrays for excluding elements form the email, In the first array, you can enter the beginning of a form element name, the second is the ending of a form element name, the last is used for any part of the form element name. you could add those two to the includes array:

php:
<?php

$remove 
= array();
$remove[]  = "";
$remove[]  = "x";
$remove[]  = "y";

$removeBegins = array();
$removeBegins[] = "Security";

$removeEnds = array();
$removeEnds[] = "_x";
$removeEnds[] = "_y";

$removeIncludes = array();
$removeIncludes[] = "Security";
$removeIncludes[] = "Hidden_Field";
$removeIncludes[] = "SimpleContact_submit";
?>
Sign in to reply to this post

Sally

Thank you, Jason. As always, you are very helpful.

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post

CraigRBeta Tester

Great, - this post was just what I was looking for.

Is there an easy way to rename the array keys ?

Sign in to reply to this post

Jason ByrnesWebAssist

no, if your rename the arrays, you need to edit the code that uses the arrays to use the new array names.

Sign in to reply to this post

CraigRBeta Tester

Hi Jason,

I'm not looking to rename the arrays, just the array keys.

for example, my page has several text fields txtfirstname, txt lastname etc.

what i would like to do is drop the txt prefix and put a space between the first and name, without renaming the fields

Sign in to reply to this post

Jason ByrnesWebAssist

ahhh, that's a totally different can of worms.....


in the template file, look for the following code:

php:
<?php echo(str_replace("_"," ",$pkey)); ?>




and change it to:

php:
<?php echo(str_replace("_"," ",str_replace("txt","",$pkey))); ?>
Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...