473,473 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

What does this code do?

I've got a form which has the following code:

<form action="/cgi-bin/FormMail.pl" method="POST"
language="JavaScript"
onsubmit="return FrontPage_Form1_Validator(this)"
name="FrontPage_Form1">

It works, but I don't understand it. If I try and use this code on
another site it fails (Error: Object expected), but works with:

<form action="/cgi-bin/FormMail.pl" method="POST"
language="JavaScript"
onsubmit="return true">

I think the object expected is "true", and I can see that the method in
the original code may return true or false, but I don't know where this
validation code is! Neither site has FrontPage extensions.
--
Nige

Please replace YYYY with the current year
ille quis mortem cum maximus ludos, vincat
Jul 20 '05 #1
5 5690
"Nige" <uY***@ntlworld.com> wrote in message
news:li********************************@4ax.com...
I've got a form which has the following code:

<form action="/cgi-bin/FormMail.pl" method="POST"
language="JavaScript"
onsubmit="return FrontPage_Form1_Validator(this)"
name="FrontPage_Form1">

It works, but I don't understand it. If I try and use this code on
another site it fails (Error: Object expected), but works with:

<form action="/cgi-bin/FormMail.pl" method="POST"
language="JavaScript"
onsubmit="return true">

I think the object expected is "true", and I can see that the method in
the original code may return true or false, but I don't know where this
validation code is! Neither site has FrontPage extensions.
--
Nige

Please replace YYYY with the current year
ille quis mortem cum maximus ludos, vincat

In the HTML source,
look for a JavaScript "include" file such as

<script language="javascript" src="Validator.js"></script>

that contains:

function FrontPage_Form1_Validator(...) {
...
}

Jul 20 '05 #2
In comp.lang.javascript, McKirahan wrote:
In the HTML source,
look for a JavaScript "include" file such as

<script language="javascript" src="Validator.js"></script>

that contains:

function FrontPage_Form1_Validator(...) {
...
}


None found, but you led me onto the trail. There is a FrontPage web-bot
that does it; this is hidden when in FrontPage (sigh!).
--
Nige

Please replace YYYY with the current year
ille quis mortem cum maximus ludos, vincat
Jul 20 '05 #3
"Nige" <uY***@ntlworld.com> wrote in message
news:3e********************************@4ax.com...
In comp.lang.javascript, McKirahan wrote:
In the HTML source,
look for a JavaScript "include" file such as

<script language="javascript" src="Validator.js"></script>

that contains:

function FrontPage_Form1_Validator(...) {
...
}


None found, but you led me onto the trail. There is a FrontPage web-bot
that does it; this is hidden when in FrontPage (sigh!).


What is a WebBot?

A WebBot is a web-based robot program capable of performing certain
automatic operations. FrontPage WebBots are used by Microsoft to invoke many
of the interactive features built into FrontPage. Those features are added
to your site through the FrontPage Editor.

http://www.subspacenet.com/support/frontpage.htm
Chapter 20
Automation with FrontPage's WebBots

WebBots greatly streamline the development process and eliminate the need to
write your own scripts or add complicated HTML commands. With a WebBot you
can collect the results from forms, automatically add navigation bars,
create pages with full text searches, allow registered users to access key
areas of your Web site, and much more. There is no programming involved at
all.

http://www.emu.edu.tr/english/facili...r/bookslib/Mic
rosoft%20FrontPage%20Unleashed,%20by%20William%20R obert%20Stanek/ch20.htm
Jul 20 '05 #4
Nige wrote:
I've got a form which has the following code:

<form action="/cgi-bin/FormMail.pl" method="POST"
language="JavaScript"
onsubmit="return FrontPage_Form1_Validator(this)"
name="FrontPage_Form1">

It works, but I don't understand it. If I try and use this code on
another site it fails (Error: Object expected), but works with:

<form action="/cgi-bin/FormMail.pl" method="POST"
language="JavaScript"
onsubmit="return true">

I think the object expected is "true", and I can see that the method in
the original code may return true or false, but I don't know where this
validation code is! Neither site has FrontPage extensions.


Here is what is likely happening...

Somewhere in your source code that works, you have something like:
<SCRIPT LANGUAGE="JavaScript" SRC="something.js"></SCRIPT>

This means that it is loading some javascript code, likely including
FrontPage_Form1_Validator in the code.

In the version that fails, either you do not have the line, including
the javascript, or the code is not in the proper place on your server,
or both. Because of this, when you try to run the form validator, it
has never been defined, and you get a failure.

If you do not care about form input validation, you likely do not need
to worry about the function... just a guess.

Without seeing the server, it could be a different answer.
Brian

Jul 20 '05 #5
Nige wrote:
I've got a form which has the following code:

<form action="/cgi-bin/FormMail.pl" method="POST"
language="JavaScript"
onsubmit="return FrontPage_Form1_Validator(this)"
name="FrontPage_Form1">

It works, but I don't understand it.
Me too. It is invalid HTML (the `form' element does not
have a `language' attribute), and you have not provided
the FrontPage_Form_1_Validator(...) function.
If I try and use this code on another site it fails
(Error: Object expected),
You have not included the above function, so you cannot call it.
but works with:

<form action="/cgi-bin/FormMail.pl" method="POST"
language="JavaScript"
onsubmit="return true">
Of course. There is no function called here, only the `onsubmit'
handler is used in overkill (the event is never canceled, so the
event handler could be just left out.)

And it is still invalid HTML, the default scripting language (for
event handlers) is to be defined within the `head' element with

<meta http-equiv="Content-Script-Type" content="text/javascript">

(for JavaScript.)
I think the object expected is "true",
No. If `false' is returned, the `submit' event is canceled,
otherwise, and especially if `true' is returned, it is not.
The "object expected" is the Function object to be called
that is undefined.
and I can see that the method in the original code may return true
or false, but I don't know where this validation code is! Neither
site has FrontPage extensions.


I seriously doubt that. Nothing undefined can be called.[1]
PointedEars
___________
[1] By chance, this is quite similar to "Kiri-kin-tha's First Law of
Metaphysics": Nothing unreal exists. (Yes, we had a ST:4 re-run
here recently ;-))
Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

70
by: Roy Yao | last post by:
Does it mean "(sizeof(int))* (p)" or "sizeof( (int)(*p) )" ? According to my analysis, operator sizeof, (type) and * have the same precedence, and they combine from right to left. Then this...
7
by: Fendi Baba | last post by:
The function is called from opencalendar(targetfield). Thanks for any hints on what could be the problem. .............................................................. var...
8
by: Kim Forbes | last post by:
I am learning Javascript; and most books only give you partial definitions for the functions they show you. Here is a line of code from a browser sniffing function: var isWin =...
58
by: Larry David | last post by:
Ok, first of all, let's get the obvious stuff out of the way. I'm an idiot. So please indulge me for a moment. Consider it an act of "community service".... What does "64bit" mean to your friendly...
2
by: hsharsha | last post by:
Consider the below code: int main(void) { class inner {}; friend class inner; /* what does this signify???? */ return 0; }
21
by: Niu Xiao | last post by:
I see a lot of use in function declarations, such as size_t fread(void* restrict ptr, size_t size, size_t nobj, FILE* restrict fp); but what does the keyword 'restrict' mean? there is no...
10
by: tony | last post by:
Hello!! I have some demo programs written in C# and they have this construction "" see below. I haven't seen this before so what does it mean ? public bool ShowDropDownButtons { get {...
92
by: Heinrich Pumpernickel | last post by:
what does this warning mean ? #include <stdio.h> int main() { long l = 100; printf("l is %li\n", l * 10L);
9
by: James Dow Allen | last post by:
How about this idea? Post fragments of C code which seem fun, interesting or instructive. Puzzles can be posed in various ways. (What does this do? Can you see the bug? How to code this for...
3
by: qianz99 | last post by:
Hi I am not sure what this code does. I have the following questions 1. where is the case? 2. #define TLV_INTEGER(name, octets) p->name = -1; Is it define a function TLV_INTEGER(name, octets) ...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.