close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

UE3 Multiple field in body

Thread began 5/03/2012 8:31 am by mistersmith307820 | Last modified 6/21/2012 1:37 pm by mistersmith307820 | 1451 views | 8 replies |

mistersmith307820

UE3 Multiple field in body

I am adding another text field to an existing contact form. The site owner wants a phone number field to be sent. I have added the input field here on my testing server, but now need to edit the wizard.
Under the body tab on the editor, in the edit mode I want to post "Phone".

My current code looks like this:
<?php echo ((isset($_POST["Subject"]))?$_POST["Subject"]:"")?>

should the new code look like this?
<?php echo ((isset($_POST["Phone"]))?$_POST["Phone"]:"")?>
<?php echo ((isset($_POST["Subject"]))?$_POST["Subject"]:"")?>


As a side question, what code is added so that when a visitor clicks in a text field the initial value disappears so they can input their own without having to erase first?


thanks!!

the page in question can be located at laumont dot com/Info/submit-a-query.php

Sign in to reply to this post

Jason ByrnesWebAssist

Assuming that the name of the form element in question is named "Phone", then the new code is correct.


you could clear the default value using a javascript onFocus event, for example, change:

<input name="Name" type="text" id="Name" value="Your Name" size="30" maxlength="50" />



to:

<input name="Name" type="text" id="Name" value="Your Name" size="30" maxlength="50" onFocus="if(this.value == 'Your Name') this.value='';"/>
Sign in to reply to this post

mistersmith307820

I changed the code to what I have listed above and I get a javascript error (see picture)

Sign in to reply to this post

mistersmith307820

Am I able to change the setting right in the code? WAUE_pagename.php in the WA_Universal_Email folder?

add to the section

//Start Mail Body
$MailBody = $MailBody . "";
$MailBody = $MailBody . ((isset($_POST["Subject"]))?$_POST["Subject"]:"");
$MailBody = $MailBody . "";
//End Mail Body

perhaps?

Sign in to reply to this post

Jason ByrnesWebAssist

yes, you could change:


php:
//Start Mail Body

$MailBody = $MailBody . "";
$MailBody = $MailBody . ((isset($_POST["Subject"]))?$_POST["Subject"]:"");
$MailBody = $MailBody . "";
//End Mail Body





to:

php:
//Start Mail Body

$MailBody = $MailBody . "Subject: ";
$MailBody = $MailBody . ((isset($_POST["Subject"]))?$_POST["Subject"]:"");
$MailBody = $MailBody . "";
$MailBody = $MailBody . "Phone: ";
$MailBody = $MailBody . ((isset($_POST["Phone"]))?$_POST["Phone"]:"");
$MailBody = $MailBody . "";
//End Mail Body
Sign in to reply to this post

mistersmith307820

Awesome and thanks!

Both solutions worked, onfocus and $_post.

Thanks a million Jason

Sign in to reply to this post

mistersmith307820

Each form entry on a new line

I have incorporated this into another site, but this one has more fields to be in the body of the email.
How would I get each form field to be on a new line of the email instead of one long string?

this is how I have it now


//Start Mail Body
$MailBody = $MailBody . "Name: ";
$MailBody = $MailBody . ((isset($_POST["Name"]))?$_POST["Name"]:"");
$MailBody = $MailBody . "";
$MailBody = $MailBody . "Email: ";
$MailBody = $MailBody . ((isset($_POST["Email"]))?$_POST["Email"]:"");
$MailBody = $MailBody . "";
$MailBody = $MailBody . "Phone: ";
$MailBody = $MailBody . ((isset($_POST["Phone"]))?$_POST["Phone"]:"");
$MailBody = $MailBody . "";
$MailBody = $MailBody . "Message: ";
$MailBody = $MailBody . ((isset($_POST["Subject"]))?$_POST["Subject"]:"");
$MailBody = $MailBody . "";
//End Mail Body

Sign in to reply to this post

Jason ByrnesWebAssist

add \r\n for line breaks:

//Start Mail Body
$MailBody = $MailBody . "Name: ";
$MailBody = $MailBody . ((isset($_POST["Name"]))?$_POST["Name"]:"");
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . "Email: ";
$MailBody = $MailBody . ((isset($_POST["Email"]))?$_POST["Email"]:"");
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . "Phone: ";
$MailBody = $MailBody . ((isset($_POST["Phone"]))?$_POST["Phone"]:"");
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . "Message: ";
$MailBody = $MailBody . ((isset($_POST["Subject"]))?$_POST["Subject"]:"");
$MailBody = $MailBody . "\r\n";
//End Mail Body

or use <br> tags:
//Start Mail Body
$MailBody = $MailBody . "Name: ";
$MailBody = $MailBody . ((isset($_POST["Name"]))?$_POST["Name"]:"");
$MailBody = $MailBody . "<br>";
$MailBody = $MailBody . "Email: ";
$MailBody = $MailBody . ((isset($_POST["Email"]))?$_POST["Email"]:"");
$MailBody = $MailBody . "<br>";
$MailBody = $MailBody . "Phone: ";
$MailBody = $MailBody . ((isset($_POST["Phone"]))?$_POST["Phone"]:"");
$MailBody = $MailBody . "<br>";
$MailBody = $MailBody . "Message: ";
$MailBody = $MailBody . ((isset($_POST["Subject"]))?$_POST["Subject"]:"");
$MailBody = $MailBody . "<br>";
//End Mail Body

Sign in to reply to this post

mistersmith307820

great!
<br>
did the trick!

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...