From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 23949 invoked from network); 20 Oct 1998 22:31:02 -0000 Received: from mail.redhat.com (199.183.24.239) by mail2.redhat.com with SMTP; 20 Oct 1998 22:31:02 -0000 Received: from scaup.prod.itd.earthlink.net (scaup.prod.itd.earthlink.net [207.217.120.49]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id SAA07242 for ; Tue, 20 Oct 1998 18:22:30 -0400 Received: from tellico (1Cust207.tnt12.atl2.da.uu.net [153.36.87.207]) by scaup.prod.itd.earthlink.net (8.8.7/8.8.5) with ESMTP id PAA16597; Tue, 20 Oct 1998 15:22:22 -0700 (PDT) Reply-To: From: "Thatcher Hubbard" To: "Tom Techoueyres" Cc: "AXP" Subject: RE: [PHP3] Required fields Date: Tue, 20 Oct 1998 17:20:26 -0500 Message-ID: <000501bdfc77$d65bf360$0100a8c0@tellico> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Importance: Normal PHP would do it just fine, but that requires an actual submit and reload of the page. I've had the best luck with JavaScript. Name your variables: Then, don't put a submit button at the bottom of the page, just put a plain old button that calls a JavaScript function called validate() or whatever. function validate() { if document.formname.dumb = "dumb" alert("Dumb"); else alert("Not dumb"); formname.submit; } This is a good way to do limited input validation. If you have to do a lot of it, it's good to write an actual include file with a validate function. The advantage is that you don't have to reload the page, and, you have to learn some JavaScript in order to do it. Netscape's developer.netscape.com has a good piece on input validation with JavaScript. -----Original Message----- From: Tom Techoueyres [mailto:tom@ns.eurobase.net] Sent: Tuesday, October 20, 1998 1:47 PM To: php3@lists.php.net Subject: [PHP3] Required fields Hi, What is the command in PHP that requires a field in a form not to be empty? I created a form and some fields are required, if the field is left blank I would like to return an error message saying that the field needs to be filled out. Any feedback would be appreciated. Thanks, Tom Techoueyres tom@eurobase.net -- PHP 3 Mailing List http://www.php.net/ To unsubscribe send an empty message to php3-unsubscribe@lists.php.net To subscribe to the digest list: php3-digest-subscribe@lists.php.net For help: php3-help@lists.php.net Archive: http://www.php.net/mailsearch.php3