Tag Archives: label

set_label()

set_label(mixed $col, mixed $label) : $this

Set form element label

Parameters

mixed $col
  • Database table column name
mixed $label
  • Label

Change Form Element Label

By default form displays database column name as input element label. You can change it with method set_label().

$dbForm = new C_DatabaseForm("SELECT * FROM Employees", "EmployeeID", "Employees");
$dbForm -> set_label("EmployeeID", "Employee ID");
$dbForm -> set_label("LastName", "Last Name");
$dbForm -> set_label("FirstName", "First Name");
$dbForm -> set_label("BirthDay", "DOB");
$dbForm -> display();

Live demo

PHP Database Form
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.