Bug #7057
closedHidden field displays in browser
0%
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
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' ?
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.
Updated by Jim Pingle almost 8 years ago
- Category set to Web Interface
- Target version set to 2.3.3
- Affected Version set to 2.3.x