Project

General

Profile

Actions

Bug #7057

closed

Hidden field displays in browser

Added by Stilez y almost 8 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Web Interface
Target version:
Start date:
12/31/2016
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
2.3.x
Affected Architecture:

Description

firewall_rules_edit.php on Firefox 50.1, see attached screenshot

Html looks correct (contains "hidden" parameter) so why isn't it being hidden as expected?

</div>    <div class="form-group">
        <label class="col-sm-2 control-label">
            Floating
        </label>
            <div class="col-sm-10">
        <input class="form-control" name="floating" id="floating" type="hidden" value="floating">

    </div>

Files

floating.png (6.71 KB) floating.png Stilez y, 12/31/2016 03:38 AM
Actions #1

Updated by Phillip Davis almost 8 years ago

PR https://github.com/pfsense/pfsense/pull/3329
I made the "Floating" field be created with the same construction as other hidden fields in firewall_rules_edit, taking it out of the section and now it does not display.
I haven't looked under the hood at all - perhaps something in addInput() needs to be fixed to handle 'hidden' ?

Actions #2

Updated by Jim Thompson almost 8 years ago

  • Assignee set to Anonymous
Actions #3

Updated by Anonymous almost 8 years ago

Using the addGlobal() method is the best way to do this as Phil has demonstrated. That creates a simple input without the div, label and help text that would be added with an addInput() call.

Otherwise the input is hidden, but the label you specified, and the form-group that surrounds it are not.

If you need your hidden element to be un-hidden at some point though, use the Javascript functions for this. Try:

hideInput("floating", true); in the JS

That function locates the input, then locates the parent div and hides the whole thing.

While it would be possible to modify Sjon's Form_Input class to NOT render the div or the label if the input type is hidden, that may well break other things and it seems to me that the existing methods work well enough.

Actions #4

Updated by Anonymous almost 8 years ago

  • Status changed from New to Resolved
Actions #5

Updated by Jim Pingle over 7 years ago

  • Category set to Web Interface
  • Target version set to 2.3.3
  • Affected Version set to 2.3.x
Actions

Also available in: Atom PDF