This topic is locked

checkbox problems

10/24/2006 6:29:58 PM
PHPRunner General questions
C
Chris Patterson author

I have some ENUM fields in my database with values set as 'yes','no'

I have set the fields in the form as check boxes and it all looks good.....
But......
if I add a new record I can tick the checkboxes but on viewing the record they all appear un ticked ??

if I then remove the checkbox and leave it as a field it has the word 'no' in it !!

But if I browse the MySQL database the feild has been set to 'yes'
Am I missing something ??
I hope you can unsterstand this, not sure if I have explained it very well.
Sorry this should have been posted in phprunner

J
Jane 10/25/2006

Chris,
There is no special support of ENUM types in the PHPRunner. ENUM field are treated as VARCHAR.
I recommend you the following:

  1. select Custom on the "View as" settings dialog on the Visual Editor tab and add your code.

    Here is a sample:
    if ($value=="yes")

    $value = "<img src=\"images/check_yes.gif\">";

    else

    $value = "<img src=\"images/check_no.gif\">";


2. select Radio button on the "Edit as" settings dialog and add Yes and No values.
If you want to use Checkbox use INT or TINYINT field type in your database.

C
Chris Patterson author 10/25/2006

Chris,

There is no special support of ENUM types in the PHPRunner. ENUM field are treated as VARCHAR.
I recommend you the following:

  1. select Custom on the "View as" settings dialog on the Visual Editor tab and add your code.

    Here is a sample:
  2. select Radio button on the "Edit as" settings dialog and add Yes and No values.
    If you want to use Checkbox use INT or TINYINT field type in your database.






Thanks Jane I will give it a try later.