run code only when submit button is pressed

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to execute a block of code only when a form is submitted. I am using FrontPage 2002 tied to an Access database for the form. I have tried everything from if statements to onchange events and can not get it to work. Right now if my form page is simply opened, the code in that page is automatically executed (it should only execute when the form is submitted). The other challenge is that frontpage has some standard validation routines. If I tie anything to "onsubmit", all the standard validation is lost (ie, need to keep existing validation).

What general approach should I take to resolve this issue? Any example code would be greatly appreciated (ie, I'm very new to this stuff).

Thanks!
 
You can't mix both custom JS and FP validation. You would have write the
entire validation.

Since you are using ASP, you could always move the function that you want to
call on submit, to a separate page, etc.

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================


Gary Ameye said:
I am trying to execute a block of code only when a form is submitted. I
am using FrontPage 2002 tied to an Access database for the form. I have
tried everything from if statements to onchange events and can not get it to
work. Right now if my form page is simply opened, the code in that page is
automatically executed (it should only execute when the form is submitted).
The other challenge is that frontpage has some standard validation routines.
If I tie anything to "onsubmit", all the standard validation is lost (ie,
need to keep existing validation).
What general approach should I take to resolve this issue? Any example
code would be greatly appreciated (ie, I'm very new to this stuff).
 
Hi Gary,

Append your validation code to the generated validation code using NotePad.
--
Mike -- FrontPage MVP '97-'02
http://www.websunlimited.com
FrontPage Add-ins Since '97 2003 / 2002 / 2000 Compatible
----------------------------------------------------------------------------
--------------------
If you think I'm doing a good job, let MS know at (e-mail address removed)

Gary Ameye said:
I am trying to execute a block of code only when a form is submitted. I
am using FrontPage 2002 tied to an Access database for the form. I have
tried everything from if statements to onchange events and can not get it to
work. Right now if my form page is simply opened, the code in that page is
automatically executed (it should only execute when the form is submitted).
The other challenge is that frontpage has some standard validation routines.
If I tie anything to "onsubmit", all the standard validation is lost (ie,
need to keep existing validation).
What general approach should I take to resolve this issue? Any example
code would be greatly appreciated (ie, I'm very new to this stuff).
 
Back
Top