drop down box display

2 posts by 2 authors in: Forums > CMS Builder
Last Post: March 3, 2011   (RSS)

Re: [dmn] drop down box display

By Jason - March 3, 2011

Hi,

We have a function called "selectedIf". This compares two values and if they are the same, it outputs selected = "selected" (ie, selects that drop down value.

Here's an example of how you can use this:

<form method="POST" action="cableselection.php" style="margin:0;">
<select name="category" onchange="this.form.submit();"><option value="none">- please select</option>
<option value="Mono Conductor" <?php selectedIf('Mono Conductor' , @$_REQUEST['category'] );?> >Mono Conductor</option>
<option value="Multi Conductor" <?php selectedIf('Multi Conductor' , @$_REQUEST['category'] );?>>Multi Conductor</option>

</select>
</form>


Hope this helps get you started.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/