From: "Thatcher Hubbard" <hubbardj@earthlink.net>
To: "Tom Techoueyres" <tom@ns.eurobase.net>
Cc: "AXP" <axp-list@redhat.com>
Subject: RE: [PHP3] Required fields
Date: Tue, 20 Oct 1998 17:20:26 -0500 [thread overview]
Message-ID: <000501bdfc77$d65bf360$0100a8c0@tellico> (raw)
In-Reply-To: <Pine.LNX.3.96.981020144344.21921A-100000@ns.eurobase.net>
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:
<INPUT TYPE=TEXT NAME="Dumb">
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
parent reply other threads:[~1998-10-20 22:31 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <Pine.LNX.3.96.981020144344.21921A-100000@ns.eurobase.net>]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox