当前位置: 移动技术网 > IT编程>网页制作>CSS > 关于input 中 hidden属性在后台作用的实例

关于input 中 hidden属性在后台作用的实例

2018年08月27日  | 移动技术网IT编程  | 我要评论

在双模的项目中,我遇到了一个问题,我公司的双模项目是基于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,转载请申明来源

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网