I have encountered an issue with a form element (a checkbox) that I integrated into a UI form. When the page loads, the Chrome F12 debugger indicates that display: none;
has been applied as a style to the element:
element.style {
display: none;
}
This mysterious styling is visible in the Styles pane of the Chrome debugger for the <input>
element on my form. Surprisingly, attempting to uncheck this style in the debugger proves futile - the checkmark remains stuck in place while other styles can be easily unchecked.
Below is the relevant snippet of HTML code:
...
<div class="box">
...
<form id="edit-dish" action="..." method="post">
<div class="form">
...
<p>
<input id="one-label-per-serving"
name="ingredient[one_label_per_serving]"
type="checkbox"
autocomplete="off"
class="checkbox checkbox-inline validate[required]"
<?php if ( Arr::get($dish, 'one_label_per_serving', FALSE) ): ?>
checked="checked"
<?php endif; ?> />
<span class="checkbox-label">One label per serving</span>
</p>
...
</div>
...
</form>
...
</div>
...
The mentioned dots represent omitted details assumed irrelevant.
While the <span>
element displays correctly, the <input>
checkbox inexplicably has display: none;
applied to its inline style upon page load.
In addition, there are automatically included sidebar, header, and footer by a template.
It is likely that one of the loaded Javascript libraries is causing this anomaly. The following JavaScript files are detected in Chrome's debugger:
jquery.min.js
jquery-ui.min.js
jquery.tmpl.min.js
fileuploader.js
jquery.form.js
jquery.reveal.js
jquery.validationEngine-en.js
jquery.validationEngine.js
jquery.wysiwyg.js
master.v2.js // <-- this is the application's custom script
The master.v2.js
script is the customized application script. Despite searching through it, no instance of setting display: none;
for this particular element is found.
If anyone has insights on which Javascript file could be responsible for applying display: none;
, or guidance on debugging this issue, your input would be greatly appreciated.
Thank you.