贴出代码<?php
if($user==$pro)
{
$smarty->assign('select','<form action="select_offer.php" method="post" target="_blank"><input name="offer_id" type="hidden" value="{$arr_misneed[offer].offneed_id}" /><input name="submit" type="button" value="设置中标" /></form>');
}
else
{
$smarty->assign('select',"");
}$smarty->display('need_view.html');
?>
{$select}在模板页面是处于一个循环当中的
部分代码如下{section name=offer loop=$arr_misneed}
内容{$arr_misneed[offer].offneed_text}|¥{$arr_misneed[offer].offneed_price}|时间{$arr_misneed[offer].offneed_time}|{$select}{sectionelse} there is some error! {/section} 结果是能出来按钮,但是按钮按了没反应....
还有就是~~隐藏域中的值还是{$arr_misneed[offer].offneed_id}而没有正常循环出来数字ID隐藏域中的值没有出来,我就想会不会是因为加载了模板显示了第一次所assign的{$select}的值之后就不再显示第二次的{$arr_misneed[offer].offneed_id}而按钮按了没反应。。我就想不通了。。
希望大家能指点一下~~
if($user==$pro)
{
$smarty->assign('select','<form action="select_offer.php" method="post" target="_blank"><input name="offer_id" type="hidden" value="{$arr_misneed[offer].offneed_id}" /><input name="submit" type="button" value="设置中标" /></form>');
}
else
{
$smarty->assign('select',"");
}$smarty->display('need_view.html');
?>
{$select}在模板页面是处于一个循环当中的
部分代码如下{section name=offer loop=$arr_misneed}
内容{$arr_misneed[offer].offneed_text}|¥{$arr_misneed[offer].offneed_price}|时间{$arr_misneed[offer].offneed_time}|{$select}{sectionelse} there is some error! {/section} 结果是能出来按钮,但是按钮按了没反应....
还有就是~~隐藏域中的值还是{$arr_misneed[offer].offneed_id}而没有正常循环出来数字ID隐藏域中的值没有出来,我就想会不会是因为加载了模板显示了第一次所assign的{$select}的值之后就不再显示第二次的{$arr_misneed[offer].offneed_id}而按钮按了没反应。。我就想不通了。。
希望大家能指点一下~~
解决方案 »
- 谢谢
- php+mssql获取最后插入id值问题(在线等~)
- 不知道能否解密,请大牛们看一下
- 这句PHP是啥意思?!$step && $sizelimit/=2;
- 我准备学习php ,不知道该学PHP4,还是PHP5,现在的空间大部分支持PHP4还是PHP5啊
- php+access做留言板的一些疑问
- 请教用php怎么实现在客户端读取IC卡+读卡器中的数据!?
- 页面中的值传递的问题?
- 为什么我在php(win下)中注册session非要注册两次才注册得上?
- 问两个简单的php语法问题.
- 请教一个架构相关的东西
- 响应版主号召,发点入门教学文章 - 简单说下redis主从复制过程以及我发现的一个导致我线上业务出bug的不起眼特性
按钮的问题解决掉了~~~然后~~隐藏域的问题~~我试着这样if($view_arr[0]['misneed_user']==$_SESSION['userid']&&$view_arr[0]['misneed_status']==0)
{
$smarty->assign('select','<form id="form2" name="form2" action="select_offer.php" method="post" target="_blank"><input name="offer_id" type="hidden" value="');
$smarty->assign('select3','" /><input name="submit2" type="submit" value="设置中标" /></form>');
}
else
{
$smarty->assign('select',"");
}模板文件中{section name=offer loop=$arr_misneed} 内容{$arr_misneed[offer].offneed_text}|¥{$arr_misneed[offer].offneed_price}|时间{$arr_misneed[offer].offneed_time}| {$select}{$arr_misneed[offer].offneed_id}{$select3}
{sectionelse} there is some error! {/section} 这样可以在当php文件中if条件成立的时候显示正常
但if条件不成立的时候却显示的逻辑错误了所以~~想请教一下~~在smarty中想输出隐藏域..域中有从数据库中取出的值~~而且该表单处于循环当中(就好像上面一样)~~可以用什么方法解决呢?
你的只是一个普通按钮,又不是submit
<input name="submit" type="submit" value="设置中标" />