How is email validation done with Front Page 2003?

S

sheetrum

I have found an email validation script online. I am trying to figure out
just how to insert it into the webpage I am building. The form is built and
the form fields properties have been set. I am confused about how the script
is to be run when the "Submit" button is hit.

Does the entire script need to be inserted in the page or just saved on the
website to be run?
 
A

Andrew Murray

Follow the instructions that came with the script.

It is independent of Frontpage.

However, I suspect if it's a javascript, you would put a segement of code in
your < input type> for the button

eg <input type="submit" name="submit" value="Submit"
onsubmit="validateEmail();">

or similar.

The onsubmit calls the javascript function that "validates" the email.

The script you have is not going to tell you the email the user enters
really exists, only that the user has entered a bunch of characters in the
format "[email protected]".

Without further info of what the script really does (can you give more
details?) maybe it is a script that validates "required" fields, which you
can do through frontpage anyway by right-clicking (or double clicking) the
field you want and select "field Properties" then go to "Validation".

The only way you'll know if they enter a real email is if you don't get the
bounced email message back if you send out email letters etc.

You open the the script you downloaded in notepad; then copy and paste it
into the page in Frontpage that requires it. Copying and pasting from
notepad into frontpage ensures you're copying plain text so the html will be
written correctly rather than like the funny codes you see sometime that
represent the characters such as "<" and ">"

Again, follow the instructions that came with the script - or use the
support of the site that had the script (forums, support email etc).

Is it an external js file or is it a script that you'll insert into the html
code?

If it is external you need to put this line in your <head>

<script language="javascript" src="<your folder/validate.js">

(I think that's correct, anyway, can somone else confirm this?)

Hope this helps
 
S

sheetrum

Here are some of the instructions that came with the script:

The first step in using this script is to select the code from the text box
below and copy it into a file called email.js.

You next attach the script into your web page that has forms containing
email addresses by adding the following code into the head section of your
page.
<script type="text/javascript" src="email.js">
</script>
All that remains then is to call it using the following statement from
either the onblur event of the email field itself and / or the onclick or
onsubmit event of the submission button or form:
valid_email =
validateEmail(email_field,mandatory,messages);



I am new to scripting, so all code that I have previously done was by copy
and paste. After a little trial and error, I was able to make it do what I
needed. What is the difference between an external js file and inserting the
script into the code?

In your post you stated that the input type for the button would look like
this:
eg <input type="submit" name="submit" value="Submit"
onsubmit="validateEmail();">

Can you better explain the ="validateEmail();" part of that code and
what it is referring to?
 
A

Andrew Murray

sheetrum said:
Here are some of the instructions that came with the script:

The first step in using this script is to select the code from the text
box
below and copy it into a file called email.js.

You next attach the script into your web page that has forms containing
email addresses by adding the following code into the head section of your
page.
<script type="text/javascript" src="email.js">
</script>
All that remains then is to call it using the following statement from
either the onblur event of the email field itself and / or the onclick or
onsubmit event of the submission button or form:
valid_email =
validateEmail(email_field,mandatory,messages);



I am new to scripting, so all code that I have previously done was by copy
and paste. After a little trial and error, I was able to make it do what
I
needed. What is the difference between an external js file and inserting
the
script into the code?

In your post you stated that the input type for the button would look like
this:
eg <input type="submit" name="submit" value="Submit" >
onsubmit="validateEmail();">

Can you better explain the ="validateEmail();" part of that code
and
what it is referring to?


The above code I provided is an example of what the instructions said -
using the "onsubmit" event - and it was just a 'guess' - I don't know if the
syntax is correct or not. The script's instructions should provide precise
details I'd expect.

The difference between external js file and putting the code in the html
page : if you have a script that is 200 lines of code, you might need to use
such a script a few times; that means copying that code into several pages,
and if there are errors in the code, you have to go through every copy of
the script to fix the errors.

With the external js file, you insert one line of code: > <script
type="text/javascript" src="email.js">
</script> and you're done. For debugging or troubleshooting the script,
you open the js file in either notepad or in Frontpage and you can fix the
code errors in one file, which when saved and published will then work
correctly across all the pages using it.
 
Top