在双模的项目中,我遇到了一个问题,我公司的双模项目是基于ECShop的框架,在完成订单列表的页面时,我写了两个form表单来单独传输数据,第一个表单是用来做搜素的,第二个表单是用来显示表单信息的,在控制器中我并不是用index方法来渲染这个页面的,这是这个问题的关键,我用的是同一个控制器下的productionOrderList方法,所以在第一个form表单里,我需要传连个东西,分别是 app act。下面就来看看我的具体代码吧

 <!--  搜索表单  -->
<form name='form' method='get' style="padding-bottom:15px;">
<input type="hidden" name="app" value="{$smarty.get.app}"/> //关键所在
<input type="hidden" name="act" value="{$smarty.get.act}"/>//关键所在
<table width='98%' border='0' cellpadding='1' cellspacing='1' bgcolor='#cfcfcf' align="center" style="margin-top:8px">
<tr bgcolor='#f8f8f8'>
<td align='left'><table border='0' cellpadding='0' cellspacing='0' height="32">
<tr> <td style="padding: 0px 0px 4px 3px;">
<input name="order_type" type="hidden" id="order_type" value="{$smarty.get.order_type}" />
订单号:<input name="order_sn" type="text" id="order_sn" value="{$smarty.get.order_sn}" />
&nbsp;商品名称:<input name="goods_name" type="text" id="goods_name" value="{$smarty.get.goods_name}" />
&nbsp;生产编号:<input name="production_sn" type="text" id="production_sn" value="{$smarty.get.production_sn}" />&nbsp;
工艺说明:<input name="craft_name" type="text" id="craft_name" value="{$smarty.get.craft_name}" />
<br>
&nbsp;下单时间:<input name="s_time" type="text" id="begin_add_time" value="{$smarty.get.begin_add_time}" />
- &nbsp;<input name="e_time" type="text" id="end_add_time" value="{$smarty.get.end_add_time}" />
&nbsp;
<!--联系方式:<input name="phone_mob" type="text" id="phone_mob" value="{$smarty.get.phone_mob}" />-->
{if $smarty.get.order_type}
&nbsp;门店筛选:
<select name="store_name" id="store_name">
<option value=''>选择门店</option>
{foreach from=$store_name item=store_name}
<option value='{$store_name}' {if $smarty.get.store_name eq $store_name}selected{/if}>{$store_name}</option>
{/foreach}
</select>
{/if}
{if $smarty.get.order_type}
&nbsp;服务订单<select name="wf_status" id="wf_status">
<option value=''>全部订单</option>
<option value=11 {if $smarty.get.wf_status eq 11}selected{/if}>待付款</option>
<option value=1 {if $smarty.get.wf_status eq 1}selected{/if}>待服务</option>
<option value=2 {if $smarty.get.wf_status eq 2}selected{/if}>服务中</option>
<option value=3 {if $smarty.get.wf_status eq 3}selected{/if}>已服务</option>
</select>
{else}
&nbsp;生产状态:
<select name="status" id="status">
<option value='all'>全部状态</option>
<option value='0' {if $smarty.get.status eq '0'}selected{/if}>取消订单</option>
<option value='10' {if $smarty.get.status eq '10'}selected{/if}>已接单</option>
<option value='11' {if $smarty.get.status eq '11'}selected{/if}>待审核</option>
<option value='20' {if $smarty.get.status eq '20'}selected{/if}>生产中</option>
<option value='30' {if $smarty.get.status eq '30'}selected{/if}>生产完成</option>
<option value='31' {if $smarty.get.status eq '31'}selected{/if}>质检完成</option>
<option value='40' {if $smarty.get.status eq '40'}selected{/if}>已出库</option>
<option value='50' {if $smarty.get.status eq '50'}selected{/if}>订单完成</option>
<!--<option value='deleted' {if $smarty.get.status eq 'deleted'}selected{/if}>用户已删除</option>-->
<!--
<option value=''>待退货</option>
<option value=''>已退货</option>
<option value=''>已退款</option>
-->
</select>
{/if}
&nbsp;&nbsp;<input class="np" type="image" src="templates/images/button_search.gif" width="60" height="22" border="0" style="vertical-align: top; margin-top: 3px;" />
</td>
</tr>
</table></td>
</tr>
</table>
</form>
<!-- 内容列表 -->
<form name="form2" class="submitForm" action="index.php?app=craft_order&productionOrderList" load="index.php?app=craft_order&act=drop_craft">
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#D6D6D6">
<tr>
<td height="28" colspan="12" background="{res file=images/tbg.gif}">
<table width='96%' cellpadding='0' cellspacing='0'>
<tr>
<td height="28" background="/manager/templates/images/tbg.gif" style="padding-left:10px;" colspan="3"> ◆工艺及客户管理&nbsp;&gt;&nbsp;生产管理列表 &nbsp;</td>
<!--<td align='right'>-->
<!--<a href="index.php?app=craft&act=addCraft" class='np coolbg'>增加工艺</a>-->
<!--</td>-->
</tr>
</table>
</td>
</tr>
<tr align="center" bgcolor="#f8f8f8" height="25">
<td width="3%">选择</td>
<td width="10%">订单信息</td>
<td width="5%">生产编号</td>
<td width="10%">商品名称</td>
<td width="7.5%">工艺说明</td>
<td width="4%">数量</td>
<td width="12.5%">提单时间</td>
<td width="12.5%">生产日期</td>
<td width="12.5%">质检时间</td>
<td width="5%">质检结果</td>
<td width="5%">生产状态</td>
<td width="10%">操作</td>
</tr>
<!--{if !empty($orderList)}-->
<!-- {foreach from=$orderList item=item name=list} -->
<tr align="center" bgcolor="#FFFFFF" height="26" align="center" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';">
<td class="list-text">
<input name='id[]' type='checkbox' class="chooseNow" value='{$item.id}' />
</td>
<td>
{$item.order_sn|default:-}
</td>
<td>
{$item.production_sn|default:-}
</td>
<td>
{$item.goods_name|default:-}
</td>
<td>
{$item.craft_name|default:-}
</td>
<td>
{$item.user_goods_total|default:-}
</td>
<td>{if $item.add_time!=''}{$item.production_time|date:Y-m-d H:i:g}{else}--{/if}
</td>
<td>{if $item.production_time!=''}{$item.production_time|date:Y-m-d H:i:g}{else}--{/if}
</td>
<td>{if $item.production_end_time!=''}{$item.production_end_time|date:Y-m-d H:i:g}{else}--{/if} </td>
<td>
{$item.qualityTestingChinese|default:-}
</td>
<td>
{if $item.statusChinese}{$item.statusChinese}
{else}--
{/if}
</td>
<td width="" class="list-text">
<div class="lista">
<a href="index.php?app=craft&act=addCraft&id={$item.id}">查看</a>
{if $item.status==10}<span>|</span><a href="index.php?app=craft&act=addCraft&id={$item.id}">随工单</a>{/if}
{if $item.status==40}<span>|</span><a onclick="member_delete({$item.id})" href="javascript:;">更改结算</a>
{/if} </div>
</td>
</tr>
<!--{/foreach}-->
<tr bgcolor="#ffffff">
<!--<td height="36" colspan="12">&nbsp; <a class="coolbg" id="checkAll" href="javascript:;">全选</a> <a class="coolbg" id="unCheck" href="javascript:;">取消</a> <a class="coolbg" id="printing" href="javascript:;">&nbsp;打印&nbsp;</a> <a class="coolbg" id="unCheck" href="javascript:;">取消</a></td>-->
<td height="36" colspan="12">
<a href="javascript:;" id="checkAll" class="coolbg">全选</a>
<a href="javascript:;" id="unCheck" class="coolbg">取消</a>
<a href="javascript:;" id="print_all" class="coolbg">打印</a>
<a href="javascript:;" id="export_all" class="coolbg">导出</a>
<a href="javascript:;" id="export_condition" class="coolbg" title="导出上面筛选条件的所有订单">条件导出</a>
{if $site_config.store_info.store_id==267321 ||$site_config.store_info.store_id==254451 || $site_config.store_info.store_id==257417}
<a href="javascript:;" id="export_goods" class="coolbg" title="导出上面筛选条件的商品汇总单">
条件导出
</a>
{/if}
<a href="javascript:;" id="batch_hide" class="coolbg">批量删除</a>
<a href="javascript:;" id="batch_print_all" class="coolbg">批量打印随工单</a>
</td>
</tr>
<!--{else}-->
<tr align="right" bgcolor="#f8f8f8">
<td height="36" colspan="12" align="center"><span>您的数据为空</span></td>
</tr>
<!--{/if}-->
<tr bgcolor="#f8f8f8">
<td height="36" colspan="12" align="center">
{$pageShow}
</td>
</tr>
</table>
</form>
</div>

这两行代码就是重点

  <input type="hidden" name="app" value="{$smarty.get.app}"/> //关键所在
<input type="hidden" name="act" value="{$smarty.get.act}"/>//关键所在

没有这两个传输的话,点击搜索是没有效果的

本地项目在http://m.123.local.qushiyun.com/manager/index.php?app=craft_order&act=productionOrderList

感想:现在遇到的问题都是在为日后成为大神而添加的瓦片

注:本文来源于我雨中笑之个人的简书https://www.jianshu.com/p/cf56475a58b5,转载请申明来源

关于input 中 hidden属性在后台作用的实例的更多相关文章

  1. Hmtl5 <input>中placeholder属性(新属性)

    Hmtl5 <input>中placeholder属性(新属性) 一.定义和用法 placeholder 属性提供可描述输入字段预期值的提示信息(hint). 该提示会在输入字段为空时显示 ...

  2. input中autocomplete属性

    autocomplete="off":表示刷新页面时,input中的value值清空 <input type="text" id="q" ...

  3. javascript中ClassName属性的详解与实例

    在javascritp中,我们可以通过style属性可以控制元素的样式,从而实现行为层通过DOM的style属性去干预显示层显示的目标,但是这种方法是不好的,而且为了实现通过DOM脚本设置的样式,你不 ...

  4. js中__proto__, property, prototype, 对象自身属性方法和原型中的属性方法的区别

    __proto__: 这个属性是实例对象的属性,每个实例对象都有一个__proto__属性,这个属性指向实例化该实例的构造函数的原型对象(prototype). proterty:这个方法是对象的属性 ...

  5. input标签的hidden属性的应用及作用

    定义:传输关于客户端/服务器交互的状态信息. Transmits state information about client/server interaction. 解释: 此元素在页面中不显示,在 ...

  6. input中id和name属性的区别。

    input中id和name属性的区别. 做网站很久了,但到现在还没有搞明白input中name和id的区别,最近学习jquery,又遇到这个问题,就在网上搜集资料.看到这篇,就整理出来,以备后用. 可 ...

  7. input中的disabled、readonly和hidden

    最近开发项目的时候,遇到一个问题,就是我希望某个input中的值不能被修改,刚开始的时候,我想到的是disabled属性!但是,发现表单提交后,值无法传递过来! 解决方法: 可以设置其readonly ...

  8. input标签的hidden属性,四大常用JSTL标签库

    input标签的hidden属性的应用及作用 定义:传输关于客户端/服务器交互的状态信息. Transmits state information about client/server intera ...

  9. html <input>标签类型属性type(file、text、radio、hidden等)详细介绍

    html <input>标签类型属性type(file.text.radio.hidden等)详细介绍 转载请注明:文章转载自:[169IT-最新最全的IT资讯] html <inp ...

随机推荐

  1. 学习markdown语法,易读易写,放2个教程地址

    http://wowubuntu.com/markdown/basic.html http://wowubuntu.com/markdown/basic.html

  2. PC站与H5移动站最佳适配方案

    HTML5是目前HTML的最屌版本,同时也是建设移动站的最佳技术.百度适时推出PC站与H5移动站的最佳适配方案,对站长而言实在是久旱逢甘霖.详情如下: PC站与H5移动站最佳适配方案 pc端: 在pc ...

  3. Eclipse工程部署到Tomcat时出现中文乱码问题

    1.修改Server.xml文件:添加URIEncoding="UTF-8" <?xml version="1.0" encoding="UTF ...

  4. php 实现无限极分类

    原始数据 $array = array( array('id' => 1, 'pid' => 0, 'n' => '河北省'), array('id' => 2, 'pid' ...

  5. anaconda 换源

    2019.4.24更新: 清华源停止维护了(见:https://mirrors.tuna.tsinghua.edu.cn/news/close-anaconda-service/).以下方法不再适用. ...

  6. [BZOJ 4488][Jsoi2015]最大公约数

    传送门 不知谁说过一句名句,我们要学会复杂度分析 #include <bits/stdc++.h> using namespace std; #define rep(i,a,b) for( ...

  7. vi vim 查找替换

    #查找# / 光标向下查找 ?光标向上查找 按键盘n,继续查找 #替换# :s/hello/test/ 替换光标所在行第一个hello为test :s/hello/test/g  替换光标所在行所有h ...

  8. Scrum3.0 敏捷开发白皮书

    一.什么是敏捷? 敏捷是一种以用户需求为核心.采用不断迭代的方式进行的软件开发模式.敏捷依靠自组织 的跨职能小团队,在短周期内,做出小块的东西来,通过快速.频繁的迭代,迅速的获取反 馈,进而不断的完善 ...

  9. java中的线程(3):线程池类 ThreadPoolExecutor「线程池的类型、参数、扩展等」

    官方文档: https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ThreadPoolExecutor.html 1.简介 pu ...

  10. Mina初识

    1.概述 1.1 Apache的顶级项目,基于java NIO,支持TCP/IP.UDP/IP: 1.2 Mina对外屏蔽了java NIO使用的复杂性,并在性能上做了不少的优化: 1.3 Mina采 ...