使select option达到超链接的效果实例

2017-08-14 19:37:52来源:CSDN作者:cominglately人点击

分享

参考文档:  http://www.51itstudy.com/it/article/7043.html

opetion value 为url 

select  在加上onchange的事件, 

onChange="window.open(this.options[this.selectedIndex].value);"

<select class="form-control" name="province" onChange="window.open(this.options[this.selectedIndex].value);">    <?php if ($input['province']) {?>    <option value="{:U('index',array('flow_type'=>'','telecom'=>'','errorlevel'=>$input['errorlevel'],'province' => $province,'sid' => $input['sid'],'tel' => $input['tel'],'status' => $input['status'],'cid' => $input['cid'],'begin' => $input['begin'],'end' => $input['end'],))}">        {$input['province']}</option>    <?php } ?>    <option value="{:U('index',array('flow_type'=>'','telecom'=>'','errorlevel'=>$input['errorlevel'],'province' => '','sid' => $input['sid'],'tel' => $input['tel'],'status' => $input['status'],'cid' => $input['cid'],'begin' => $input['begin'],'end' => $input['end'],))}">爬虫渠道</option>    <foreach name="crawler_areas"  item="province">        <option value="{:U('index',array('flow_type'=>'','telecom'=>'','errorlevel'=>$input['errorlevel'],'province' => $province,'sid' => $input['sid'],'tel' => $input['tel'],'status' => $input['status'],'cid' => $input['cid'],'begin' => $input['begin'],'end' => $input['end'],))}">            {$province}        </option>    </foreach></select>




微信扫一扫

第七城市微信公众平台