This topic is locked

CHECKBOXES View As/Add As

2/15/2020 4:04:38 AM
PHPRunner General questions
M
mlal author

I have an integer field in my database that represents an order status.

0 = Order Cancelled

1 = Order Confirmed

2 = Order in Production

... and so forth.
In EDIT/View AS, I can choose to show this field as Radio Button. But how do I correlate the values to the labels?

ie if value = 0, then ORDER CANCELLED is CHECKED

if value = 1, then ORDER CONFIRMED is CHECKED

Same goes for the ADD part of the page.

N
Nir Frumer 2/15/2020



I have an integer field in my database that represents an order status.

0 = Order Cancelled

1 = Order Confirmed

2 = Order in Production

... and so forth.
In EDIT/View AS, I can choose to show this field as Radio Button. But how do I correlate the values to the labels?

ie if value = 0, then ORDER CANCELLED is CHECKED

if value = 1, then ORDER CONFIRMED is CHECKED

Same goes for the ADD part of the page.


hi

the easiest way is to create an orderStatus table

this also solves the issue of not having to change the code in case of a future.
hope it helps,

Nir.