当页面刷新时,继续隐藏HTML输入字段? [英] Continuing to hide HTML input fields when page refreshes?

查看:144
本文介绍了当页面刷新时,继续隐藏HTML输入字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在HTML页面上,有一个与各种下拉菜单和文本框一致的过滤器部分。当选择'type_of_report'下拉列表时,'onchange'事件将会隐藏所有与'type_of_report'不相关的输入。过滤条件通过GET(通过PHP $ _GET获取)保存。

On a HTML page there is a filter section consistenting of various drop-downs and textboxes. When the 'type_of_report' drop-down is selected the 'onchange' event will hide all the non-relevant inputs for that 'type_of_report'. The filter criteria is preserved via GET (which I retrieve via PHP $_GET).

问题是当我提交表单(运行报告)时,隐藏页面刷新时,字段将重新出现。

The problem is that when I submit the form (run the report) the 'hidden' fields re-appear when the page refreshes.

当页面刷新时,如何保持不相关的输入栏隐藏?

How do I keep the non-relevant input fields hidden when the page refreshes?

注意:我使用jQuery(1.4.2)隐藏字段。

NOTE: I am using jQuery (1.4.2) to hide the fields.

更新1:

最终缩写解决方案(基于反馈)如下所示:

Final abbreviated solution (based on feedback) looks like this:

<?php
$report_type = $_GET['report_type'];
?>
<html>
<head>
   <!-- hiding/unhiding based on report type -->
   <script type="text/javascript" src="hide.js"></script>
</head>
<body onLoad="hideall('<?php echo"$report_type"; ?>');">

...rest of code


推荐答案

设置会话变量以保持下拉框的状态。而当您将其加载到视图端口时...使用会话变量过滤它们。它应该可以解决你的问题。

Setup a session variables to keep the status of the drop down boxes. And while you are loading it in the view port... filter them using the session variable. It should solve your problem.

这篇关于当页面刷新时,继续隐藏HTML输入字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆