Sorry for the duplicate post there!

AFAIF your function should return false if the e-mail or name verification
fails. If you don't return false it'll do the alert, put the focus on the
field that is wrong then submit the form anyway.

Giles

----- Original Message -----
From: "Colm Brazel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 24, 2002 4:02 PM
Subject: RE: [ cf-dev ] Javascript with cfinclude?


>
> >>does
> your function maybe need to return true/false?
>
> No, it checks a name has been entered and checkes correct email entry
using@
> and returns user to their input box if error found..
>
> <script language="Javascript">
> <!--
> //This checks if the user enters a name in the name field.
> //It checks if the field is empty, and if it is, an alert box pops up.
> function validateForm()
> {
>   var TITLE1=true
>   if (document.form1.TITLE1.value=="")
> {
>     name=false
>     alert("You need to give your name?")
>     document.form1.TITLE1.focus()
>   }
>
> }
>   //Now for the email detection.
>   var at = document.form1.email2.value.indexOf("@",0)
>   if (at < 1 && name)
> {
>     name = false
>     alert ("Put an @ symbol in!")
>     document.form1.email2.focus()
>   }
> //-->
> </script>
>
>
>  rgds
>
> Colm
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:duncan.cumming@;alienationdesign.co.uk]
> Sent: 24 October 2002 15:18
> To: [EMAIL PROTECTED]
> Subject: RE: [ cf-dev ] Javascript with cfinclude?
>
>
>
> what exactly happens, what type of javascript error are you getting?  does
> your function maybe need to return true/false?  check things like case
> sensitivity of your variable names, etc.
>
>
> Duncan Cumming
> IT Manager
>
> http://www.alienationdesign.co.uk
> mailto:duncan.cumming@;alienationdesign.co.uk
> Tel: 0141 575 9700
> Fax: 0141 575 9600
>
> Creative solutions in a technical world
>
> ----------------------------------------------------------------------
> Get your domain names online from:
> http://www.alienationdomains.co.uk
> Reseller options available!
> ----------------------------------------------------------------------
> ----------------------------------------------------------------------
>
>
>
>                     Adrian Lynch
>                     <adrian.l@thoughtb        To:
> "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
>                     ubble.net>                cc:
>                                               Subject:     RE: [ cf-dev ]
> Javascript with cfinclude?
>                     10/24/02 03:15 PM
>                     Please respond to
>                     dev
>
>
>
>
>
> It shouldn't be the includes messing things up. All the JS stuff happens
on
> the client machine so if it's sound it should work.
>
> Ade
>
> -----Original Message-----
> From: Colm Brazel [mailto:c.brazel@;ntlworld.ie]
> Sent: 24 October 2002 15:14
> To: [EMAIL PROTECTED]
> Subject: [ cf-dev ] Javascript with cfinclude?
>
>
> related problem, I have the following generic javascript in the header of
a
> file,
> <script language="Javascript">
> <!--
>      //This checks if the user enters a name in the name field.
>   //It
> checks if the field is empty, and if it is, an alert box pops
> up.
> function validateForm()
>  {
>    var theform=true
>     if
> (document.form1.TITLE1.value=="")
>  {
>     name=false
>     alert("You need to
> give your name?")
>     document.form1.TITLE1.focus()
>     }
>
>   }
> //Now for the email detection.
>     var at =
> document.form1.email2.value.indexOf("@",0)
>         if (at < 1 && name)
> {
>     name = false
>     alert ("Put an @ symbol in!")
> document.form1.email2.focus()
>      }
>     //-->
>            </script>
>
> But the form itself is in another file included with cfinclude with the
> code
> to the javascript,
> <input type="submit" value="Submit" name="B12" onclick="return
> validateForm()">
>               <input type="reset" value="Reset" name="B22">
>
> On the same page as the included file is some CF errror checking which
> works, but the javascript does not, is the problem to do with the fact the
> form is included on the page, I`ll check later by putting the form
directly
> on the page that uses it. Anyone pointers on why this code should crash,
> I`ll check if javascript is turned on in the browser as well:-)
>
> cheers
>
>
>
> Colm
>
> Colm Brazel MA
> CB Publications
>
> www.cbweb.net <http://www.cbweb.net>
> [EMAIL PROTECTED] <mailto:design@;cbweb.net>
> [EMAIL PROTECTED] <mailto:cbweb@;iol.ie>
>
>
>
>
>
>
> -----Original Message-----
> From: Robertson-Ravo, Neil (REC)
> [mailto:Neil.Robertson-Ravo@;csd.reedexpo.com]
> Sent: 24 October 2002 13:32
> To: '[EMAIL PROTECTED]'
> Subject: RE: [ cf-dev ] OT: Javascript validating checkboxes
>
>
> ah, found the 'bug'; I was asking it to check for the button
> name..........muppet
>
> -----Original Message-----
> From: Rich Wild [mailto:r.wild@;e-mango.com]
> Sent: 24 October 2002 13:10
> To: '[EMAIL PROTECTED]'
> Subject: [ cf-dev ] OT: Javascript validating checkboxes
>
>
> Neil, post your code...
>
>
> --
> ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> For human help, e-mail: [EMAIL PROTECTED]
>
> --
> ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> For human help, e-mail: [EMAIL PROTECTED]
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.394 / Virus Database: 224 - Release Date: 10/3/2002
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.394 / Virus Database: 224 - Release Date: 10/3/2002
>
>
> --
> ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> For human help, e-mail: [EMAIL PROTECTED]
>
> --
> ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> For human help, e-mail: [EMAIL PROTECTED]
>
>
>
>
>
>
> --
> ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> For human help, e-mail: [EMAIL PROTECTED]
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.394 / Virus Database: 224 - Release Date: 10/3/2002
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.394 / Virus Database: 224 - Release Date: 10/3/2002
>
>
> --
> ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> For human help, e-mail: [EMAIL PROTECTED]
>


-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to