Someone set up a database with enum values, example:
field: price_range
enum: 'Less than $10','$10 - $25','$25 - 50','More than $50'
I hardcoded the drop-down box. Now, how can I make it SELECT the current value in the DB?
Current code (I've tried different variations of this):
$num = $frm->select("price_range","Price Range:");
if ($price_range=="Less than $10") $a='Yes';
else $frm->option("",'None',$num,$a);
$frm->option('Less than $10','Less than $10',$num,$a);
if ($price_range=="$10 - $25") $a='Yes';
else $frm->option("",'None',$num);
$frm->option('$10 - $25','$10 - 25',$num,$a);
if ($price_range=="$25 - $50") $a='Yes';
else $frm->option("",'None',$num);
$frm->option('$25 - $50','$25 - $50',$num,$a);
if ($price_range=="More than $50") $a='Yes';
else $frm->option("",'None',$num);
$frm->option('More than $50','More than $50',$num,$a);
It either adds SELECTED to all options, or to none!
Thanks.
eatley@tribweb.com