Bug #7083
closedPut back some visual hint for required fields
0%
Description
Pretty sure the convention was that the <fielddescr>
for a <required/>
field was shown in bold in pfSense before 2.3. That's definitely gone with bootstrap conversion, now everything is bold there, so - without further description - it's impossible for users to say which fields must be filled in and which are optional.
The "bold" fontface was not a good hint anyway, using some small icon, or color, or something else would be definitely useful though.
Files
Updated by Anonymous almost 8 years ago
- Status changed from New to Feedback
Added:
When composing an element with a form.class or via XML, prepend a '*' to the title to indicate a required field. This will cause the "element-required" class to be added to the label. pfSense.css now contains the style associated with that class. (Currently a custom underline).
e.g.:
$section->addInput(new Form_Input(
'name',
'*Name',
'text',
$pconfig['name']
))->setPattern('[a-zA-Z0-9_]+')->setHelp('The name of the alias may only consist '.
'of the characters "a-z, A-Z, 0-9 and _".');
Updated by Anonymous almost 8 years ago
pkg_edit.php has been updated to automatically add the '*' if <required> is set
Updated by Anonymous almost 8 years ago
- % Done changed from 0 to 100
Applied in changeset 57026d17d43a096c3a594a248c183a6889e7956d.
Updated by Anonymous almost 8 years ago
- Assignee changed from Anonymous to Kill Bill
- % Done changed from 100 to 0
Updated by Kill Bill almost 8 years ago
Works nicely (tested with a recent 2.3.3 snapshot and bunch of packages - squid, ntopng, shellcmd, ftpproxy). Thanks.
Updated by Renato Botelho almost 8 years ago
- Status changed from Feedback to Resolved
Updated by Phillip Davis almost 8 years ago
Sometimes the "required" status of a field is data dependent and needs to be set/cleared as the page loads depending on the data in other fields, and as the user changes the data in other fields. So some pages may want to addClass('element-required') and removeClass('element-required') on-the-fly.
Here is an example on the Interfaces page:
https://github.com/pfsense/pfsense/pull/3406
It would be nice to have infrastructure that provides some "easy" way to find the relevant span tag and adjust its class(es) on-the-fly.
Updated by Phillip Davis almost 8 years ago
- File DialOnDemandCheckbox.gif DialOnDemandCheckbox.gif added
Dependency between Dial On Demand checkbox and Idle Timeout field
Updated by Anonymous almost 8 years ago
I have added a new function to pfSenseHelpers.js to allow an input to be dynamically set as required (or not). e.g.:
setRequired('descr', true); // set the element named 'descr' to be a required input by adding // the 'element-required' class to its label
Updated by Jim Pingle almost 8 years ago
- Status changed from Resolved to Assigned
- Assignee changed from Kill Bill to Anonymous
- Target version changed from 2.4.0 to 2.3.3
Looks like this was partially merged back to 2.3.3 but not all of it. Fields have the * before the name and are not showing the underline formatting.
Updated by Anonymous almost 8 years ago
The mechanism required to do this has been ported to 2.3.3 but it looks like quite a few pages do not yet have the '*' to indicate a required field. Tested with vpn_openvpn_server.php
Updated by Phillip Davis almost 8 years ago
Reported in forum: https://forum.pfsense.org/index.php?topic=125403.0
I am seeing the "*" displayed in the (some) places where it is backported to 2.3.3, but it is not being converted to an underline. I did a full ctrl-F5 to make sure my browser reloaded all its JS.
Updated by Anonymous almost 8 years ago
On which page do you see that Phil?
I assumed you synced in the last few minutes?
Updated by Phillip Davis almost 8 years ago
Oh, I see now that you just committed that supporting code to RELENG_2_3. I noticed the issue this morning my time (whenever I posted that on the forum - maybe 10 hours ago. I will update my 2.3.3 VM now.
Updated VM is working fine, thanks. Required fields are underlined.
Now I think it is just that not all the '*' required field markings have been back-ported. So some GUI pages have the underlining and others do not. That makes the UI inconsistent, but does not break anything.
Updated by Phillip Davis almost 8 years ago
I have noted on GitHub a couple of commits in master that did not get back-ported. @rbgarga is back-porting them right now. I also noticed 1 other field that could be marked required in firewall_aliases_edit - PR https://github.com/pfsense/pfsense/pull/3523 - that could also go back to RELENG_2_3
That should make everything consistent between 2.4 and 2.3.3
Updated by Renato Botelho almost 8 years ago
- Status changed from Assigned to Feedback
I believe it's all done now
Updated by Renato Botelho almost 8 years ago
- Status changed from Feedback to Resolved
Everything looks OK now. Thanks Phil!