This topic is locked

Check box (Y/N)

10/10/2005 8:46:06 AM
PHPRunner General questions
K
keithh0427 author

Hi,
I'd like to use a checkbox as a Yes/No field. If it's checked when adding a record then a "Y" is added to the table, otherwise a "N" is added.
Same thing in reverse when viewing and editing. If the table column is "Y" then the box is checked. In it's "N", then the box remains unchecked.
thanks.

Sergey Kornilov admin 10/11/2005

Hi,
open include\..._functions.php file by any text editor. Find GetDatafunction.

Insert the following code snippet right after it.

if($field=="YourField")

  {

    if($data["YourField"]==1)

return "Y";

return "N";

  }


Please note field name is case sensitive.