Re: Form - response required?

by "Brian Sloan" <brian(at)sloan29.freeserve.co.uk>

 Date:  Thu, 17 Aug 2000 18:37:14 +0100
 To:  "Karen & Rob Pickel" <pegleg(at)rapidnet.com>
 Cc:  <hwg-basics(at)hwg.org>
 References:  rapidnet
  todo: View Thread, Original
Maybe you've already received a reply about this, but you need to put this
in your form tag:

<FORM NAME="myform" onsubmit="check()">

and then this script somewhere in your document.

<SCRIPT LANGUAGE="JavaScript">
function check()
{
if(document.myform.name.value == " ")
{
alert("Please enter your name")
return false
}
else
{
document.myform.submit()
}
}
</SCRIPT

You need to add an if statement, before else, similar to the one above, for
each form field. For example:
if(document.myform.email value == " ")

etc.

HTH

Brian Sloan
----- Original Message -----
From: "Karen & Rob Pickel" <pegleg(at)rapidnet.com>
To: <hwg-basics(at)hwg.org>
Sent: Wednesday, August 16, 2000 10:11 PM
Subject: Form - response required?


> Hi all!
>
> I have a form all put together but now I need some
> way to assure that they enter certain fields (such as
> name/address) How can I go about this? I just need
> something simple like a pop-up box saying "Please
> enter your name" or "Please enter your address" when
> they don't remember.
>
> I know it can't be all that hard, but it eludes me....... sigh
>
> Thanks to all you smart people out there!!
> Take care,
> Karen Pickel
> ( pegleg(at)rapidnet.com )
>
>

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA