Showing Selected Values on a Multiselect box
<p>I have made a single page for adding as well as editing data.
In the page i have a multiselect box. I want to know how can i display the selected values in case of editing? My code is :</p>

<pre><code>$categories=$objdb-&gt;select("vtiger_cf_601", false, "*", false, false);

$discountstudentInfo = $objdb-&gt;select('paytbl_discounts_students', false, "*", "WHERE fk_paytbl_discounts_discountid = '".$_GET['discountid']."' ", false);

&lt;select id="cmbCategory[]" name="cmbCategory[]" class="combo" multiple="multiple"&gt;
                            &lt;option value="" selected="selected" &gt;Select&lt;/option&gt;
                                        &lt;?php
                                        foreach($categories as $category)
                                        {
                                            foreach($discountstudentInfo as $discountstudentinfo)
                                            {
                                                if($discountstudentinfo[fk_paytbl_discounts_discountid]==$category[cf_601id])
                                                {
                                                    $class="selected=selected";
                                                }
                                                else
                                                {
                                                    $class="";
                                                }
                                        echo '&lt;option value="'.$category[cf_601id].'" "'.$class.'"&gt;'.$category[cf_601].'&lt;/option&gt;';
                                            }                                           
                                        }       
                                        ?&gt;
                            &lt;/select&gt;
</code></pre>

<p>Regards,</p>

<p>Pankaj </p>
