This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > FrontPage Programming > May 2006 > JS & fronpage form





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author JS & fronpage form
shai w

2006-05-25, 6:41 pm

I’m using FP2003 to create a simple form.
I planted a JS function (“on click”) so once form submitted it will go to a
confirmation page depending on the original page that directed me to the form

The function works but when associated with the FP form the form won’t send
the msg. To my email

Any suggestions?

Shai w.


Here is the code:

<body>

<script type="text/javascript">
var A = document.referrer
function checkReferrer()
{
if (A == "http://www.mysite.com/page1.htm")

{
window.location="http://www.mysite.com/thankyou-page1.htm"
}

else if (A == "http://www.mysite.com/page2.htm")

{
window.location="http://www.mysite.com/thankyou-page2.htm"
}
}
</script>

<form method="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveResults" S-Label-Fields="TRUE"
B-Reverse-Chronology="FALSE" S-Builtin-Fields startspan
S-Email-Address="email@mysite.com" S-Email-Format="TEXT/PRE"
B-Email-Label-Fields="TRUE" --><input TYPE="hidden" NAME="VTI-GROUP"
VALUE="0"><!--webbot bot="SaveResults" endspan i-checksum="43374" -->
<p><input type="text" name="T1" size="20"></p>
<p><input type="submit" value="Submit" name="B1"
onclick="checkReferrer()"><input type="reset" value="Reset" name="B2"></p>
</form>

</body>

Steve Easton

2006-05-25, 10:43 pm

You can't mess with the submit button in a form, either by adding a hyperlink or a click
event as either one will break it.

You'll need to find another method.

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer




"shai w" <shaiw@discussions.microsoft.com> wrote in message
news:A7D51871-2185-4843-84B0-DC492B50A7BE@microsoft.com...
> I'm using FP2003 to create a simple form.
> I planted a JS function ("on click") so once form submitted it will go to a
> confirmation page depending on the original page that directed me to the form
>
> The function works but when associated with the FP form the form won't send
> the msg. To my email
>
> Any suggestions?
>
> Shai w.
>
>
> Here is the code:
>
> <body>
>
> <script type="text/javascript">
> var A = document.referrer
> function checkReferrer()
> {
> if (A == "http://www.mysite.com/page1.htm")
>
> {
> window.location="http://www.mysite.com/thankyou-page1.htm"
> }
>
> else if (A == "http://www.mysite.com/page2.htm")
>
> {
> window.location="http://www.mysite.com/thankyou-page2.htm"
> }
> }
> </script>
>
> <form method="POST" action="--WEBBOT-SELF--">
> <!--webbot bot="SaveResults" S-Label-Fields="TRUE"
> B-Reverse-Chronology="FALSE" S-Builtin-Fields startspan
> S-Email-Address="email@mysite.com" S-Email-Format="TEXT/PRE"
> B-Email-Label-Fields="TRUE" --><input TYPE="hidden" NAME="VTI-GROUP"
> VALUE="0"><!--webbot bot="SaveResults" endspan i-checksum="43374" -->
> <p><input type="text" name="T1" size="20"></p>
> <p><input type="submit" value="Submit" name="B1"
> onclick="checkReferrer()"><input type="reset" value="Reset" name="B2"></p>
> </form>
>
> </body>
>



Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews