That (any mailto) is not using a forms handler and will fail for many user (especially all AOL users)
--
_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________
| > | >> Hi,
| >> I am using a simple form as a test for students who work their way
| >> through
| >> a 'virtual tour' on our website. After the student takes the
| >> "test"--which
| >> is a form, really; I would like to have the option for the student
| >> to send his answers to an email address they input themselves. They
| >> could send their
| >> answers to their own email address or a teacher's email address.
| >> Is there a way to do this? I know that I can set up the form(test)
| >> to email the results to me, but its going to do the student no good.
| >> I thank you all in advance.
|
| Steve Easton wrote:
| > That requires custom server side scripting.
|
| Steve,
| I have noticed the same response from many MVPs.
|
| Wouldn't the method below work ?
| The feedback I had on this before is that the user must have an email client
| which his/her browser will use as default, but won't most?
|
| <html>
| </head>
| <script type="text/javascript">
| function checkEmailAddress(field)
| {
| // the following expression in () after 'match' must be all on one line...
| if
| (field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi))
| return true
| else
| { alert('Please enter a valid e-mail address.')
| field.focus()
| field.select()
| return false }
| }
| // --------------------
| function testform()
| {
| with (document.form1)
| {
| if (!checkEmailAddress(Email))
| return
| // more code to validate form results
| }
| }
| // --------------------
| function sendform()
| {
| with (document.form1)
| {
| var body = ''
| var i = elements.length , j = 0
| while (i-- > 2) // drop last two elements
| {
| if (elements[j].name != 'Email')
| { body += elements[j].name + ': ' + elements[j].value
| + '%0d%0a' // line break after each field }
| j += 1
| } // end while
| }
| window.location = "mailto:" + document.form1.Email.value
| + "?subject=Response%20from%20Form"
| + "&body=" + body
| }
| // --------------------
| </script>
| </head>
|
| <body>
| <div align="center" >
|
| <div style="border:1px solid #999999; width:60%;
| background-color:#F2F4FA;">
| <form name="form1" action="">
|
| <div style="background-color:#DBE0F5; padding:3px; font:75% arial;">
| <b>Form Heading</b>
| </div>
|
| <div style="padding:10px; font:75% Arial; text-align:left;">
| <p>
| Hi all,<br />
| <!-- Intro. Text in here -->
|
| Name:<br/>
| <input type="text" name="Name" value="Insert name" size="40"
| onfocus="if (this.value=='Insert name'){this.value='';};return
| false;"
| onblur="if (this.value==''){this.value='Insert name';return
| false;}"/><br/>
|
| Email:<br/>
| <input type="text" name="Email" value="Insert e-mail address"
| size="40"
| onfocus="if (this.value=='Insert e-mail
| address'){this.value='';};return false;"
| onblur="if (this.value==''){this.value='Insert e-mail
| address';return false;}"/><br/>
|
| <!-- more fields in here -->
| </p>
| </div>
|
| <!-- this <div> with these two fields to remain the last -->
| <div align="center" style="background-color:#DBE0F5; padding:3px;
| font:12px arial;">
| <input type="button" id="submit" value=" Send "
| onmouseover="testform()" onclick="sendform()" />
| <input type="reset" id="reset" value=" Clear "/>
| </div>
| </div>
|
| </form>
| </div>
|
| </div>
| </body>
| </html>
| --
| Cheers,
| Trevor L.
| Website:
http://tandcl.homemail.com.au
|
|