I used the Advanced Feature for the textfield component to place an informational label (nnn-nnn-nnnn) after a Phone field to inform the user what format was expectd.

However, this is included in the email immediately adjacent to the phone number.

How do I remove these following labels from the emails?

Thanks . . . ecsmike

CommentFileSizeAuthor
#4 WF1.jpg124.05 KBecsmike
#4 WF2.jpg84.72 KBecsmike
#2 Email.txt568 bytesecsmike

Comments

quicksketch’s picture

I'm not sure what you mean by "Advanced Feature for the textfield component". You should be able to add a "Field suffix" option to show the phone number if you like, this does not show up in generated e-mails.

ecsmike’s picture

StatusFileSize
new568 bytes

Thank you for your reply.

I am confused about the "Field Suffix option" you mentioned. I am using version 6.x.2.9 of the Webform module and see nothing like that. I used the "Label placed to the right of the textfield:" option for the Phone textfield component and it most definitely shows in the email.

Please see the attached file to view the contents of the email.

ecsMike

quicksketch’s picture

Er... as far as I know there is no "Label place to the right of the textfield" nor is there even a "Phone textfield" component. Are you sure this field is provided by Webform?

ecsmike’s picture

StatusFileSize
new84.72 KB
new124.05 KB

Sorry for confusing you. The "Phone" textfield is just a textfield to enter a phone number in.

But this is definitely the WebForm module.

Please see attached screenshots of the Admin page for configuring the Webform textfield component and the resulting form.

Thanks . . . Mike

quicksketch’s picture

Okay thanks for your persistence here, you're right. "prefix" and "suffix" is what they're called internally by Webform.

Now that I think about it, the prefix/suffix is intentionally placed there in the e-mail, since it's intended to be used for things like "lbs.", "kg.", or €. The same goes for the prefixes, which are intended to be something like $.

So... how to get rid of it if you don't want it there?

You can do this by overridding the theme function for textfields in e-mails. Open up the webform/components/textfield.inc file, and find the "theme_webform_mail_textfield" function. Copy this entire function into your theme's template.php, then remove the field_prefix and field_suffix.

ecsmike’s picture

quicksketch:

Thanks so much for sticking with this.

I tried the fix you recommended but when I tried to open the site after copying the function into template.php, the site would not open due to the following fatal error:

Fatal error: Cannot redeclare theme_webform_mail_textfield() (previously declared in /home/user_name/public_html/sites/all/modules/webform/components/textfield.inc:173) in /home/user_name/public_html/sites/all/themes/proneema/template.php on line 20

Did I do something wrong?

Thanks again . . . ecsmike

quicksketch’s picture

Sorry I didn't mention a crucial step: Copy theme_webform_mail_textfield() to template.php, then rename the function. Replace the word "theme_" with the name of your theme, such as "garland_webform_mail_textfield" if you were using Garland for example. Then clear your Drupal cache by clicking "Clear all caches" at the bottom of 'admin/settings/performance'.

quicksketch’s picture

Status: Active » Closed (fixed)