Unique

A certain attribute has to be unique in the whole database table.

Parameters:

  • attribute: the attribute that has to be unique
  • message: the message that is shown if this constraint is violated
Sample Code


// create form object
$forms = new pnFormTrash("people");
$forms->edit("lastname", "firstname");
$forms->show("lastname", "firstname");

$forms->registerHandler("unique", 
    array(
        "attribute"=>"lastname", 
        "message"=>"That lastname is already in use."
    )
);

// create html
$forms->doit(); 

Live Sample

  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.