Forums

PHP

This topic is locked

Populate Forums , Select Fields

Posted 26 Oct 2001 22:21:30
1
has voted
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>&lt;select name="background"&gt;
&lt;option value="FlagWatermark.jpg"&gt;&nbsp;&nbsp;&lt;/option&gt;
&lt;option value="&lt;?php echo $Recordset1-&gt;Fields("background"?&gt;" selected&gt;
&lt;?php echo $Recordset1-&gt;Fields("background"?&gt;
&lt;/option&gt;
&lt;option value="&lt;?php echo $Recordset2-&gt;Fields("loc"?&gt;"&gt;
&lt;?php echo $Recordset2-&gt;Fields("name"?&gt;
&lt;/option&gt;
&lt;/select&gt; </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 -&gt; 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 ---

Reply to this topic