- Expression web tabbed menus
- Expression Web Forum
- Expression web resources
- CSS Intro
- Build Expression Web Template 1
- Build Expression Web template 2
- Build Expression Web Template 3
- Style horizontal Navigation with CSS
- Style vertical menu with CSS
- Style the main content area
- Style the footer
- Centre a page
- Build Expression Web DWT Tutorial
- Graphic Template example
- Free Expression Web Templates
- Add RSS to Expression Web
- Expression web forms
- RSS feeds
- 10 Tips
- Page includes
- Insert flash in expression web
- Expression web dropdown menu
- Use XML with Expression Web
- Point and click easy drop-down menu's
- Table Based Layouts
- ASP.NET Ad Rotator
- Display Data
- Search database using a text box
- Transparent Text
- Bold text - Formatting
- Date and time
- Who are you
Forms in expression web
One of the most asked questions we get is How to add a form to expression web?
There is no simple answer - why?
Firstly, your existing FrontPage forms will work very well in expression web. Expression web will maintain your form bots and any validation that you might have in an existing form.
You can also build simple forms in Expression Web, but you will not be able to add validation rules in EW!
OK so you can hop between FP and EW and come up with the desired result!
This complicates matters in that
- You are hopping between the two programs and creating surplus non valid code as you do this.
- FP forms are really prone to spam bots - we do have a simple solution for this.
- FP/EW forms will only allow you to send to 1 e-mail address. Although there is a work around, it is a little sloppy!
- You must have FPSE for the form to work!
So that's just a handful of problems that you might encounter when using FrontPage forms or forms created in Expression Web.
So a solution? Well yes there is a solution in fact many. But it is wholly dependant on what services your host offers. Our first tutorial uses JMail, a very popular method of sending e-mails using asp.
JMail is simple to use and our sample script will cover most uses for a feedback form. See our example form here
<%@LANGUAGE = VBSCRIPT%> <%Option Explicit%> <html> <body> <% 'NOTE: YOU MUST UPDATE THE FOLLOWING 3 VARIABLES Dim strMailDomain, strMailUserName, strMailPassword strMailDomain = "www.yourdomainname.com" strMailUserName = "firstname.lastname@example.org" strMailPassword = "yourpassword" ' Get the form data from HTML form with 5 fields Dim name, senderEmail,subject,recipient,body name = Request.Form("name") senderEmail = Request.Form("email") subject = "Regarding " & Request.Form("subject") recipient = Request.Form("recipient") body = Request.Form("body") ' Create the JMail message Object Dim msg set msg = Server.CreateOBject( "JMail.Message" ) ' Enter the sender data msg.From = senderEmail msg.FromName = name 'Server Authentication msg.MailServerUserName = strMailUserName msg.MailServerPassWord = strMailPassword ' Note that as addRecipient is method and not ' a property, we do not use an equals ( = ) sign msg.AddRecipient "email@example.com" msg.AddRecipientCC "firstname.lastname@example.org" msg.AddRecipientBCC "email@example.com" ' The subject of the message msg.Subject = subject ' And the body msg.body = body ' Now send the message, using the indicated mailserver if not msg.Send(strMailDomain) then Response.write "<pre>" & msg.log & "</pre>" else Response.write "Change this content to your own thank you message: Thank you for taking the time to contact us. We will review your request as soon as possible and reply accordingly" end if ' That's it - you can add additional e-mail addresses as required. %>
That's it, quite simple! However you are not complete yet. The above code is the code for the asp page and must be saved and named : jmailExample.asp (for ease of this tutorial)
Next we actually need a form so the user can input the details.
Copy and paste the following code and save it as: feedback_form.htm
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" /> <title>Untitled 1</title> </head> <body id="page_content"> <p>Change this to your own wording - something like: 'welcome to our feedback page' </p> <h3>Please use this form to contact us.</h3> <p>ALL FIELDS ARE REQUIRED</strong></p> <form method="post" action="jmailExample.asp"> Name<br/> <input name="name" type="text" size="25" />*Required<br /> <br /> Your E-mail<br /> <input name="email" type="text" size="25" />*Required<br /> Select an option<br /> <select name="Subject" size="1" style="width: 147px"> <option>Click to dropdown</option> <option value="Join our mailing List">Join our mailing List</option> <option value="Contact Technical">Contact Technical</option> <option value="FPSE Problem">FPSE Problem</option> <option value="Contact Billing">Contact Billing</option> <option value="Link Exchange">Link Exchange</option> <option value="Comment">Comment</option> <option value="Question">Question</option> </select>*Required<br /> <br /> Type your message in the box below - *Required<br /> <textarea name="Body" cols="45" rows="10"></textarea><br /> <input name="Submit1" type="submit" value="submit" /><input name="Reset1" type="reset" value="reset" /></form> </body> </html>
The above code creates a form that does the following.
- Asks the user for a name
- Asks the user for an e-mail
- Asks the user to select a topic from the drop down list
- Asks the user to make a comment
- When submit is clicked the form will be processed and the user will be directed to a thank you page.
When the user visits your feedback form, and fills it in, you will get an e-mail at the account or accounts that you specified in the jmailExample.asp file.
If you have specified a CC and a BCC address, then the e-mail will be sent to those as well. Note* A carbon copy (CC) mail address will be listed alongside the first e-mail address in the resulting e-mails! If you want to hide a second/third/fourth...... address then use the Blind carbon copy (BCC) code line just keep on adding e-mail addresses.
The processed results.
When your e-mail arrives in your inbox, it will flow as follows:
Regarding: This value is taken from the dropdown list.
The visitors name and the visitors e-mail address [firstname.lastname@example.org]
If you have set up CC then this will also be shown
Finally the message is shown
Its that simple. But if you use outlook, you can set up rules to process your e-mails as they arrive and have outlook pop them into the folders that you want. In outlook click on tools/rules/ and create a new rule from scratch using the when certain text is in the subject. So if in your dropdown box on the form had a selection for site feed back, the resultant e-mail would have the subject set as...
Regarding Site feedback
So in your outlook rule, you would have the above text, then when someone fills in the form and selects feed back, you will get the e-mail and it will go directly to the feedback folder that you have asked outlook to place it in. This does not effect how the other recipients see the e-mail, it is up to them to set their own rules in their own outlook.
Have fun with this simple and easy method of e-mailing forms in Expression Web.
If you are having problems, why not visit our expression web forums?