Re: [SLUG] Required fields in PHP

From: rwrigh10@tampabay.rr.com
Date: Wed Feb 18 2004 - 20:08:04 EST


Paul

You should use javascript on the client side to perform the test prior to submission of the form data.

If you must use php then you will have to hit submit and then test the value for each element from the $_POST array like so:

if($_POST["myTextField"]==""){
  //code to show message of failure

}
else
{

}

----- Original Message -----
From: Paul M Foster <paulf@quillandmouse.com>
Date: Wednesday, February 18, 2004 7:29 pm
Subject: [SLUG] Required fields in PHP

> When coding forms in PHP, is there a _simple_ way to ensure certain
> required fields are actually filled out?
>
> Paul
>
>

-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 17:58:54 EDT