frontpage 'submit' button not working


G

Guest

I have made a questionnaire on frontpage and want to send it by email as an
attachment. The problem I have is that when i test it and press 'submit'
nothing happens - it just opens another webpage and no results are sent. I
have gone into the form properties and typed in an email address but i dont
why its not working!
Please help!
Or could you tell me an alternative way of receiving the results without
having a submit button?
 
Ad

Advertisements

T

Trevor L.

bex1985 said:
I have made a questionnaire on frontpage and want to send it by email
as an attachment. The problem I have is that when i test it and press
'submit' nothing happens - it just opens another webpage and no
results are sent. I have gone into the form properties and typed in
an email address but i dont why its not working!
Please help!
Or could you tell me an alternative way of receiving the results
without having a submit button?

Try thtis code
<!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">
<!-- formtest.html -->
<head>
<title>Form Test</title>

<!-- Internal JS -->
<script type="text/javascript">
function checkEmailAddress(field)
{
// the following expression in () after 'match' must be all on one line...
if
(field.value.match(/\b(^(\[email protected]).+((\.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
// Other tests in here
}
}
// --------------------
function sendform()
{
with (document.form1)
{
var body = ''
var i = elements.length , j = 0
while (i-- > 2) // drop last two elements
{
var text = elements[j].value
var tname = elements[j].name
body += tname +': ' + text + '%0d%0a' // line break after
each field }
j += 1
} // end while
}
window.location = "mailto:" + "me" + "@" + "mysite" + ".com.au"
+ "?subject=Response%20from%20Form"
+ "&body=" + body
}
// --------------------
</script>

</head>
<!-- ================================================ -->
<body>

<noscript>
This site requires Javascript enabled<br />
</noscript>

<div id="maindiv" 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>Title</b>
</div>

<div style="padding:10px; font:75% Arial; text-align:left;">
<p>
Some intro,<br />
.............
</p>

<p>
Name:<br/>
<input type="text" id="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" id="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/>

Enter Comment:<br/>
<textarea id="Comment" rows="10" cols="100"
style="font:100% Arial;">Enter your comment in
here</textarea><br />

<!-- Enter other fields in here -->

</p>
</div>

<!-- Leave these two fields as 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>

</form>
</div>

</div> <!-- end id="maindiv" -->

</body>
</html>

It is cut from another form which works, but I haven't tested it.

The key points are action="" in the form definition and the Submit button
with onmouseover= and onclick=

It is possible that the type of this button does not have to be "submit",
because the onclick= should handle it.
 
Ad

Advertisements

Joined
Feb 7, 2012
Messages
1
Reaction score
0
bex1985 wrote:
> I have made a questionnaire on frontpage and want to send it by email
> as an attachment. The problem I have is that when i test it and press
> 'submit' nothing happens - it just opens another webpage and no
> results are sent. I have gone into the form properties and typed in
> an email address but i dont why its not working!
> Please help!
> Or could you tell me an alternative way of receiving the results
> without having a submit button?


Try thtis code
<!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">
<!-- formtest.html -->
<head>
<title>Form Test</title>

<!-- Internal JS -->
<script type="text/javascript">
function checkEmailAddress(field)
{
// the following expression in () after 'match' must be all on one line...
if
(field.value.match(/\b(^(\[email protected]).+((\.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
// Other tests in here
}
}
// --------------------
function sendform()
{
with (document.form1)
{
var body = ''
var i = elements.length , j = 0
while (i-- > 2) // drop last two elements
{
var text = elements[j].value
var tname = elements[j].name
body += tname +': ' + text + '%0d%0a' // line break after
each field }
j += 1
} // end while
}
window.location = "mailto:" + "me" + "@" + "mysite" + ".com.au"
+ "?subject=Response%20from%20Form"
+ "&body=" + body
}
// --------------------
</script>

</head>
<!-- ================================================ -->
<body>

<noscript>
This site requires Javascript enabled<br />
</noscript>

<div id="maindiv" 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>Title</b>
</div>

<div style="padding:10px; font:75% Arial; text-align:left;">
<p>
Some intro,<br />
.............
</p>

<p>
Name:<br/>
<input type="text" id="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" id="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/>

Enter Comment:<br/>
<textarea id="Comment" rows="10" cols="100"
style="font:100% Arial;">Enter your comment in
here</textarea><br />

<!-- Enter other fields in here -->

</p>
</div>

<!-- Leave these two fields as 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>

</form>
</div>

</div> <!-- end id="maindiv" -->

</body>
</html>

It is cut from another form which works, but I haven't tested it.

The key points are action="" in the form definition and the Submit button
with onmouseover= and onclick=

It is possible that the type of this button does not have to be "submit",
because the onclick= should handle it.
--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au
I noticed you did a lot of work with this reply, but I have a couple of questions.

What exactly does this script do?

I created a form withFrontPage2002 and use drop downs and check boxes and fill in the blanks.

The submit button worked fine for several years with the PC, but when someone tried it on a Mac it does not work. It displays an error on the screen and you must go back and hold down the option button while hitting the submit button.

It took me awhile to figure this out, but it is still a problem with the newer technology coming out. An example is the new data phones which work fine most of the time except with this form that requires the use of the option button (which the phone does not have).

The program uses web bot and of course has been discontinued. So not updates are to be had and web bot do not fit in with html4/5. The new program does not have database scripts that work anymore.

I am stuck using this program for this account as it is the only thing out there that did it all just the way we wanted.

In a nut shell. Any PC works fine, the Mac works fine using the option button while clicking on the submit button, and the iPhone does not work because there is no option button.

Thanks for you help.
Benjamin L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top