Forums

PHP

This topic is locked

Static values in dynamic lists

Posted 09 Oct 2002 10:31:08
1
has voted
09 Oct 2002 10:31:08 Julio Taylor posted:
i'm using UD4 to create a dynamic list. it contains values taken from a table which i am using to filter records by using a number (job type). What i'd like to do is include in this list a wildcard value ('%') so i can display all records regardless of job type.

Unfortunetly i have no idea how to insert a static value into the dynamic list. I've tried adding it to the list using the UD4 interface, which of course backfired horribly and destroyed my list. Has anyone got any ideas? I know that DMX does this, but i don't use it as i've found it to be a piece of shit so far and it's causing more hassle that it's worth.

Thanks!

p.s. obviously i'm using PHP as a language. here's the code of my existing list:

<pre id=code><font face=courier size=2 id=code>
&lt;select name="job_st_id" class="form_elements_white"&gt;
&lt;?php
if ($status_list__totalRows &gt; 0){
$status_list__index=0;
$status_list-&gt;MoveFirst();
WHILE ($status_list__index &lt; $status_list__totalRows){
?&gt;
&lt;OPTION VALUE="&lt;?php echo $status_list-&gt;Fields("job_st_id"?&gt;"&lt;?php if ($status_list-&gt;Fields("job_st_id"==$HTTP_GET_VARS["job_st_id"]) echo "SELECTED";?&gt;&gt;
&lt;?php echo $status_list-&gt;Fields("job_st_name";?&gt;
&lt;/OPTION&gt;
&lt;?php
$status_list-&gt;MoveNext();
$status_list__index++;
}
$status_list__index=0;
$status_list-&gt;MoveFirst();
}
?&gt;
&lt;/select&gt;
</font id=code></pre id=code>

thanks a lot!

------------------------
Poolio

MSN:

www.eliziumdesign.com

Replies

Replied 09 Oct 2002 11:14:53
09 Oct 2002 11:14:53 Owen Eastwick replied:
Try:

&lt;select name="job_st_id" class="form_elements_white"&gt;
&lt;option value="Something"&gt;Something&lt;/option&gt;
&lt;option value="SomethingElse"&gt;SomethingElse&lt;/option&gt;
&lt;?php
if ($status_list__totalRows &gt; 0){
$status_list__index=0; $status_list-&gt;MoveFirst();
WHILE ($status_list__index &lt; $status_list__totalRows){
?&gt;
&lt;OPTION VALUE="&lt;?php echo $status_list-&gt;Fields("job_st_id"?&gt;"&lt;?php if ($status_list-&gt;Fields("job_st_id"==$HTTP_GET_VARS["job_st_id"]) echo "SELECTED";?&gt;&gt;
&lt;?php echo $status_list-&gt;Fields("job_st_name";?&gt;
&lt;/OPTION&gt;
&lt;?php
$status_list-&gt;MoveNext();
$status_list__index++;
}
$status_list__index=0;
$status_list-&gt;MoveFirst();
}
?&gt;
&lt;option value="SomethingElseAlso"&gt;SomethingElseAlso&lt;/option&gt;
&lt;option value="SomethingElseToo"&gt;SomethingElseToo&lt;/option&gt;
&lt;/select&gt;

Basically, you can add static options outside the While loop, however you may have to experiment with the "Select value Equivalent to" a little.

Regards

Owen.

Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Replied 10 Oct 2002 10:32:48
10 Oct 2002 10:32:48 Julio Taylor replied:
thanks a lot owen! <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

------------------------
Poolio

MSN:

www.eliziumdesign.com

Reply to this topic