PHP Form Empty Fields

Why

When form fields are empty, some data is not sent to the server. Sometimes the field is sent as an empty string; sometimes no field name is sent at all.

Action for empty fields

The following table illustrates the behavior of various form controls when they're not filled in or selected:

Form ControlWhat Happens When It's Not Filled In Or Selected
Text input fieldThe field name is sent, along with an empty value.
Text area fieldThe field name is sent, along with an empty value.
Password fieldThe field name is sent, along with an empty value.
File select fieldThe field name is sent, along with an empty value.
Hidden fieldThe field name is sent, along with an empty value.
Checkbox fieldNothing is sent.
Radio button fieldNothing is sent.
Pull - down menuA value is always sent.
List boxNothing is sent.
Multi - select boxNothing is sent.
Submit buttonNothing is sent if the button isn't clicked.
Image fieldNothing is sent if the button isn't clicked.
Reset buttonNothing is sent.
Push buttonNothing is sent.




















Home »
  PHP Tutorial »
    Form »




PHP Form
Form Demo