将JS数组转换为JSON并显示它

时间:2015-03-09 06:48:04

标签: php

我是编程新手,我只想在我点击搜索按钮时,我在下拉列表中选择的值必须保持选中状态... 这是代码

<select name="campaigntype" id="campaigntype" class="text dropDownNewsletter" onchange="GetCampaigns()" style="float:left; margin-right:15px;">
    <option value="">Select Campaign</option>
        <option value="1"  >OB Campaign</option>
        <option value="2">Casbo Campaign</option>

  </select>
                    <div id="selected_campaigns" style="float:left">
                    <select name="campaignid" id="campaignid" class="text dropDownNewsletter">

                        <option value="">Select Campaign</option>

                        <?php foreach($campaigns as $key=>$row){?>

                        <option value="<?php echo $row['id'];?>" <?php if( $row['id'] == $campaign_id) {?> selected="selected" <?php } ?> ><?php echo $row['id'].'-'.$row['title'];?></option>

                        <?php }?>

                     </select>

0 个答案:

没有答案