Re: Required field

by "Christian Lavoie" <clavoie(at)enter-net.com>

 Date:  Wed, 18 Feb 1998 17:20:37 -0500
 To:  "eva" <eva(at)algonet.se>,
"HTML Theory" <hwg-theory(at)hwg.org>,
"Gary Gray" <ggray(at)ep-ppp.com>
  todo: View Thread, Original
>Gary Gray <ggray(at)ep-ppp.com>
>
>
>>I have a registration form on our organization's sight. I sometimes get
>>incomplete
>>forms sent to me. I.e., one or more fields not filled in.
>>I know there is a way to make a field required. (Form will not
>>be sent unless the required field is filled in.)
>
>To make a field required a script, e.g.  FormMail (*) version 1.3 and up,
>must contain appropriate variables. Once you have a working script include
>the following in your form:
>


Right, I do requires a script (but I did heard some rumors about HTML4
having something about required-fields, I'll seek and get back with
something soon or later) but some JavaScript can actually do the trick. And
DHTML too.

JavaScript. Have a function do something like the following:

function check_it_before_sending
{

    if _INPUT_NAME_.value != ""
        then send()
    else { alert('Some required fields were left empty!');
}

There are actually some bugs in the script, but it's the global way to do it

And use DHTML to hide the Send Button until the required fields are filled.

BTW, I say the JavaScript is the best, since it is, between HTML4,
JavaScript and DHTML the one supported by the most browsers. (MSIE3.02+
NN3+). If you do have CGI-BIN access, I say use a server-side script.

><input type=hidden name=required value="name1,name2,name3">
>
>(*) http://www.worldwidemart.com/scripts/
>/e
>
>

HWG hwg-theory mailing list archives, maintained by Webmasters @ IWA