免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2765 | 回复: 2
打印 上一主题 下一主题

smarty中获取option选项的值 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-06-23 13:56 |只看该作者 |倒序浏览
smarty中获取option选项的值
html代码:
  1. <form action="team_join_new1.php" method="post">
  2.            <div class="tjnMuluDiv">
  3.                <div class="tjnMuluBox">
  4.                    <div class="list_Fa">
  5.                    <select name="optt" multiple="multiple" id="select1" style="width:200px;height:160px"
  6.                   >
  7.                        <!--{foreach item=firsts from=$first}-->
  8.                            <option value="{$firsts.id}">{$firsts.in_name}</option>
  9.                     <!-- {/foreach} -->
  10.                     </select>
  11.                     <input name="optt" type="hidden" value=""  id="optt" name="optt"/>
  12.                     </div>
  13.                     <div class="list_Fa">
  14.                     <select multiple="multiple" id="select2" style="width:200px;height:160px"
  15.                            name="class"
  16.                     >
  17.                     <!-- {foreach item=seconds from=$second} -->
  18.                         <option value="{$seconds.id}">{$seconds.in_name}</option>
  19.                     <!-- {/foreach} -->
  20.                     </select>
  21.                     </div>
  22.                     <div class="list_Fa">
  23.                     <select multiple="multiple" id="select3" style="width:200px;height:160px"></select>
  24.                     </div> <span id="select4" style="border:#F00"> </span>
  25.                </div>
  26.            </div>
  27.            <div class="topBtnDiv4"><input type="submit" name="button" id="baocun" value="下一步" /></div>
  28.           </form>
复制代码
php中:
  1. <?php
  2. require_once(dirname(__FILE__)."/../../".'inc/init.php');

  3.   $userid=$_SESSION['userid'];
  4.   /*
  5.    * 获取主目录数据
  6.    * */
  7.   $sql="select * from gp_industry where class=1";
  8.   $arr=array();
  9.   $arr=$db->getAll($sql);
  10.   $smarty->assign("first",$arr);
  11.   
  12.   echo $_POST['optt'];
  13.   

  14.   $smarty->display("team/team_join_new1.html");
  15. ?>
复制代码
没有输出结果,求解释!!!

论坛徽章:
0
2 [报告]
发表于 2011-06-25 18:53 |只看该作者
LZ,这个问题原始的提出者是我,现在我回答一下你,form表单只要跳转到下一个页面就能获取到了,但如果跳转到原来表单就无法获取的了。

论坛徽章:
0
3 [报告]
发表于 2011-06-27 17:31 |只看该作者
LZ,这个问题原始的提出者是我,现在我回答一下你,form表单只要跳转到下一个页面就能获取到了,但如果跳转 ...
路边拾草人 发表于 2011-06-25 18:53



    原因是什么?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP