开发者

Continuing to hide HTML input fields when page refreshes?

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?

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

UPDATE1:

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜