onsubmit in FP form

A

albert

I would like to call a javascript function with an onsubmit event in one of
my FP forms but FP has already inserted
onSubmit="location.href='_derived/nortbots.htm' I guess because I am using
validation. Is there a way for me to use onsubmit also? Can I put the FP code
in my function?
 
I

Ian Haynes

I would like to call a javascript function with an onsubmit event in one of
my FP forms but FP has already inserted
onSubmit="location.href='_derived/nortbots.htm' I guess because I am using
validation. Is there a way for me to use onsubmit also? Can I put the FP
code
in my function?
--

Simply separate the functions with a semi-colon.

onSubmit ="location.href='_derived/nortbots.htm'; myfunction()"

HTH
 
A

albert

This doesn't seem to work. If I place my function second, it get's ignored.
If I place it first, I get an Error 404 looking for norbots.htm.

Also, it looks like I have to edit my .htm file with the form with notepad
as FP just removes the onsubmit function I add.

Any additional thought?
 
R

Ronx

The reference to nortbots.htm indicates there is something wrong:

nortbots.htm only appears in five cases:

1) You are testing on a disc-based website, including a FrontPage or
Expression Web disc-based web that is being browsed through a
web-server.

2) You are testing on a website that does not have server extensions
installed or running.

3) The site (or form page) was FTPed from a disc-based web, or
published using a FTP address for the destination, or published to a
file system destination including a network share or UNC address (like
\\machinename\path\webname), or to an address like C:\sitename .
Publish must be to a URL of the form http://example.com

4) The site was correctly published, but the extensions were not
installed correctly or were mis-configured. Re-installing the
extensions may correct the problem. Some forms (example Search) may not
be supported by the server and may also show the error.

5) There is a bug associated with FrontPage98 which causes this
problem.

References to nortbots.htm should not appear whilst the page is being
edited in FrontPage, except perhaps when it's a loose page that has not
been opened from an open web site (and then one or more of the 5 cases
above may apply).
--
Ron Symonds - Microsoft MVP (FrontPage)
Reply only to group - emails will be deleted unread.

http://www.rxs-enterprises.org/fp
 
A

albert

FP 2002 will put the nortbots.htm in the onsubmit whenever I edit my page in
my disk based web. FP will remove the function I added and leave me with only
the nortbots.htm. The only way to get my function in the page is to edit with
notepad and ftp the file to the site. The problem with this is my function
(checkemail) does not run and I receive that wonderful 404 I mentioned
earlier. FP Server Extensions seem to be working fine in every other respect.

The URL is https://sandtechco.com/request_a_quote.htm

Can't tell you how nice it would be to get this working...Sigh
 
R

Ronx

When I edit a form in a disc based web, in Code View I see this:

<form method="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveResults" U-File="_private/form_results.csv"
S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
<p><input type="text" name="T1" size="20"><input type="submit"
value="Submit" name="B1"><input type="reset" value="Reset"
name="B2"></p>
</form>

Note there is no sign of nortbots.htm

If I open the page in a browser (using preview in browser) then
nortbots.htm will raise its ugly head - but this is testing the form in
a disc based web using a file system address - 2 of the conditions for
the appearance of nortbots.htm

The page can be http:// published - NEVER use FTP where FrontPage
extensions are concerned - to a server running the FrontPage extensions
and nortbots.htm will be banished from the published page forever.

The onsubmit function can be added while in code view without problems:

<form method="POST" action="--WEBBOT-SELF--" name="myForm"
onsubmit="myfunction('myForm')">
<!--webbot bot="SaveResults" U-File="_private/form_results.csv"
S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
<p><input type="text" name="T1" size="20"><input type="submit"
value="Submit" name="B1"><input type="reset" value="Reset"
name="B2"></p>
</form>

Preview in browser (remember this is a disc based web) and View Source
shows:

<form method="POST" action="_derived/nortbots.htm" name="myForm"
onsubmit="location.href='_derived/nortbots.htm';return false;"
webbot-action="--WEBBOT-SELF--" webbot-onSubmit="myfunction('myForm')">
<!--webbot bot="SaveResults" U-File="_private/form_results.csv"
S-Format="TEXT/CSV" S-Label-Fields="TRUE" startspan --><input
TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResults"
i-checksum="43374" endspan -->
<p><input type="text" name="T1" size="20"><input type="submit"
value="Submit" name="B1"><input type="reset" value="Reset"
name="B2"></p>
</form>

It is not possible to test a form in a disc based web, except to check
the layout.

When http published to a server, View Source in the browser shows:

<form method="POST" action="_vti_bin/shtml.dll/formtest.htm"
name="myForm" onsubmit="myfunction('myForm')"
webbot-action="--WEBBOT-SELF--">
<!--webbot bot="SaveResults" U-File="_private/form_results.csv"
S-Format="TEXT/CSV" S-Label-Fields="TRUE" startspan --><input
TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResults"
i-checksum="43374" endspan -->
<p><input type="text" name="T1" size="20"><input type="submit"
value="Submit" name="B1"><input type="reset" value="Reset"
name="B2"></p>
</form>

Notice that nortbots.htm ONLY appears when viewing from the disc based
web - not in FrontPage, not when correctly published to the server.
Also notice that what appears in the <form> tag depends on where you are
looking from - FrontPage code view, browser view source using page from
disc based web, browser view source using page from server give 3
different sets of attributes.

One other problem you might have - the form at https//etc will only
function (when uploaded correctly) if FrontPage extensions have been
installed on port 443 as well as the usual port 80.
--
Ron Symonds - Microsoft MVP (FrontPage)
Reply only to group - emails will be deleted unread.

http://www.rxs-enterprises.org/fp
 
T

Thomas A. Rowe

You have to add the FP validation, then view the form in your browser, then do a view source, then
copy the FP generated JavaScript code to notepad, add your JavaScript, then open the form back in
FP, remove all validation code, then past your modified script into your form page, also rename the
form to something that doesn't have the word FrontPage in it.

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================
 
A

albert

Gentlemen,

Thanks for your replies. I do appreciate it.
Steve - I open http:// website with Frontpage, edit the .htm that contains
the form using notepad, add my function to the onsubmit element, save the
file, then open it again and voila, my function is gone, replaced with
onSubmit="return FrontPage_Form1_Validator(this)". When I view source, it's
still gone.

Thomas, I followed your instructions as well as I could understand them.
Again, when I am done, I'm left with the onSubmit="return
FrontPage_Form1_Validator(this)". No trace of my function.

Is there no easier way to compare two password fields to help make sure I
get a valid email address?
 
T

Thomas A. Rowe

You have to rename the form and the function.

Example:
FrontPage_Form1_Validator(this)

change to

MyForm_Form1_Validator(this)

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================
 
D

Dan L

--snip--
The only way to get my function in the page is to edit with
notepad and ftp the file to the site.
--snip--

I believe if you ftp the file to the site you will "break" the form
functionality. You must upload via http: publish. You may have to reinstall
the FP Server Extensions.
 
T

Tom [Pepper] Willett

That is correct. Forms will *only* work using http publishing, not FTP.
--
===
Tom [Pepper] Willett
Microsoft MVP - FrontPage
"You're a daisy if you do!"
---
FrontPage Support:
http://www.frontpagemvps.com/
===
: --snip--
: >The only way to get my function in the page is to edit with
: > notepad and ftp the file to the site.
: --snip--
:
: I believe if you ftp the file to the site you will "break" the form
: functionality. You must upload via http: publish. You may have to
reinstall
: the FP Server Extensions.
:
: "albert" wrote:
:
: > FP 2002 will put the nortbots.htm in the onsubmit whenever I edit my
page in
: > my disk based web. FP will remove the function I added and leave me with
only
: > the nortbots.htm. The only way to get my function in the page is to edit
with
: > notepad and ftp the file to the site. The problem with this is my
function
: > (checkemail) does not run and I receive that wonderful 404 I mentioned
: > earlier. FP Server Extensions seem to be working fine in every other
respect.
: >
: > The URL is https://sandtechco.com/request_a_quote.htm
: >
: > Can't tell you how nice it would be to get this working...Sigh
: > --
: > Thanks,
: > Albert
: >
: >
: > "Ronx" wrote:
: >
: > > The reference to nortbots.htm indicates there is something wrong:
: > >
: > > nortbots.htm only appears in five cases:
: > >
: > > 1) You are testing on a disc-based website, including a FrontPage or
: > > Expression Web disc-based web that is being browsed through a
: > > web-server.
: > >
: > > 2) You are testing on a website that does not have server extensions
: > > installed or running.
: > >
: > > 3) The site (or form page) was FTPed from a disc-based web, or
: > > published using a FTP address for the destination, or published to a
: > > file system destination including a network share or UNC address (like
: > > \\machinename\path\webname), or to an address like C:\sitename .
: > > Publish must be to a URL of the form http://example.com
: > >
: > > 4) The site was correctly published, but the extensions were not
: > > installed correctly or were mis-configured. Re-installing the
: > > extensions may correct the problem. Some forms (example Search) may
not
: > > be supported by the server and may also show the error.
: > >
: > > 5) There is a bug associated with FrontPage98 which causes this
: > > problem.
: > >
: > > References to nortbots.htm should not appear whilst the page is being
: > > edited in FrontPage, except perhaps when it's a loose page that has
not
: > > been opened from an open web site (and then one or more of the 5 cases
: > > above may apply).
: > > --
: > > Ron Symonds - Microsoft MVP (FrontPage)
: > > Reply only to group - emails will be deleted unread.
: > >
: > > http://www.rxs-enterprises.org/fp
: > >
: > >
: > >
: > >
: > > : > >
: > > > This doesn't seem to work. If I place my function second, it get's
ignored.
: > > > If I place it first, I get an Error 404 looking for norbots.htm.
: > > >
: > > > Also, it looks like I have to edit my .htm file with the form with
notepad
: > > > as FP just removes the onsubmit function I add.
: > > >
: > > > Any additional thought?
: > > > --
: > > > Thanks,
: > > > Albert
: > > >
: > > >
: > > > "Ian Haynes" wrote:
: > > >
: > > > > >I would like to call a javascript function with an onsubmit event
in one of
: > > > > > my FP forms but FP has already inserted
: > > > > > onSubmit="location.href='_derived/nortbots.htm' I guess because
I am using
: > > > > > validation. Is there a way for me to use onsubmit also? Can I
put the FP
: > > > > > code
: > > > > > in my function?
: > > > > > --
: > > > >
: > > > > Simply separate the functions with a semi-colon.
: > > > >
: > > > > onSubmit ="location.href='_derived/nortbots.htm'; myfunction()"
: > > > >
: > > > > HTH
: > > > >
: > > > >
: > > > > --
: > > > > Ian Haynes
: > > > > MS MVP
: > > > > http://www.ew-resource.co.uk
: > > > >
: > > > >
: > >
: > >
 

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