Forums
This topic is locked
Populate Forums , Select Fields
26 Oct 2001 22:21:30 andy dick posted:
All, i havnt figured this out yet, but Phakt definitely seems to be pretty cool and I have noticed an increase in productivity [ end shamless shmoozing] , anyhow I am wondering how I can populate a drop-down or select list from database fields. I already tried adding the drop down and choose the field serviceName from the recordset. When I save it, it just gives me one row. What can I do to get all the services listed.-Andy
Replies
Replied 26 Oct 2001 22:40:06
26 Oct 2001 22:40:06 Keith Slater replied:
You do exactly that but then you add a repeat region. So say you put the record in the name and value. Then apply a repeat region to the whole list box. Then what I did was I went into the code and drug the repeat region around the recordset inside of the box. If you dont you'll have a lot of boxes..
Heres a code I have:
<pre id=code><font face=courier size=2 id=code><select name="background">
<option value="FlagWatermark.jpg"> </option>
<option value="<?php echo $Recordset1->Fields("background"?>" selected>
<?php echo $Recordset1->Fields("background"?>
</option>
<option value="<?php echo $Recordset2->Fields("loc"?>">
<?php echo $Recordset2->Fields("name"?>
</option>
</select> </font id=code></pre id=code>
Keith Slater
Heres a code I have:
<pre id=code><font face=courier size=2 id=code><select name="background">
<option value="FlagWatermark.jpg"> </option>
<option value="<?php echo $Recordset1->Fields("background"?>" selected>
<?php echo $Recordset1->Fields("background"?>
</option>
<option value="<?php echo $Recordset2->Fields("loc"?>">
<?php echo $Recordset2->Fields("name"?>
</option>
</select> </font id=code></pre id=code>
Keith Slater
Replied 27 Oct 2001 12:55:54
27 Oct 2001 12:55:54 Bruno Mairlot replied:
Phakt provides full featured dynamic menu/list populate ServerBehavior, actually like in all ServerFormat...
1. Create a recordset
2. Create a Form, and a menu (with nothing in it)
3. Click on ServerBehavior + button, select Dynamic Elements -> Dynamic List/Menu
Then select the value to take the value FROM, and the label too.
Click ok.
It should work.
--- Better to die trying, than never try at all ---
1. Create a recordset
2. Create a Form, and a menu (with nothing in it)
3. Click on ServerBehavior + button, select Dynamic Elements -> Dynamic List/Menu
Then select the value to take the value FROM, and the label too.
Click ok.
It should work.
--- Better to die trying, than never try at all ---