用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2937|回复: 2
收起左侧

[已解决] 着急,有关下拉框跳转页面的问题

[复制链接]
发表于 2011-8-10 14:12:38 | 显示全部楼层 |阅读模式
本帖最后由 phoenixg 于 2011-8-10 14:14 编辑

视图里面有一个下拉框:
HTML复制代码
 
<select name="type_article" id="type_article">      
 <option value="1">news</option>      
 <option value="2">testimonies</option>
</select>
 
复制代码

视图的地址是:http://localhost/ci_volunteers/index.php/cult/show/1

我希望
http://localhost/ci_volunteers/index.php/cult/show/1/1  -> 下拉框里选择news时,页面URI变成如左显示
http://localhost/ci_volunteers/index.php/cult/show/1/2   -> 下拉框里选择testimonies时,页面URI变成如左显示
依次类推

下拉框选择一个项目时,页面直接在当前页跳转,无需点击按钮提交

请教思路或写法!



发表于 2011-8-10 14:19:12 | 显示全部楼层
<select onchange="location='<?php echo site_url('cult/show'); ?>/'+this.value;">
 楼主| 发表于 2011-8-10 14:38:04 | 显示全部楼层
jeongee 发表于 2011-8-10 14:19

这来是这样写,Thank you!

本版积分规则