Project

General

Profile

Actions

Bug #7083

closed

Put back some visual hint for required fields

Added by Kill Bill almost 8 years ago. Updated almost 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Web Interface
Target version:
Start date:
01/05/2017
Due date:
% Done:

0%

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

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

required.jpg (55.8 KB) required.jpg Anonymous, 01/19/2017 10:51 AM
DialOnDemandCheckbox.gif (32.1 KB) DialOnDemandCheckbox.gif Phillip Davis, 01/20/2017 01:05 AM
Actions #1

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 _".');

Actions #2

Updated by Anonymous almost 8 years ago

pkg_edit.php has been updated to automatically add the '*' if <required> is set

Actions #3

Updated by Anonymous almost 8 years ago

  • % Done changed from 0 to 100
Actions #4

Updated by Anonymous almost 8 years ago

  • Assignee changed from Anonymous to Kill Bill
  • % Done changed from 100 to 0
Actions #5

Updated by Anonymous almost 8 years ago

Actions #6

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.

Actions #7

Updated by Renato Botelho almost 8 years ago

  • Status changed from Feedback to Resolved
Actions #8

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.

Actions #9

Updated by Phillip Davis almost 8 years ago

Dependency between Dial On Demand checkbox and Idle Timeout field

Actions #10

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
Actions #11

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.

Actions #12

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

Actions #13

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.

Actions #14

Updated by Anonymous almost 8 years ago

On which page do you see that Phil?
I assumed you synced in the last few minutes?

Actions #15

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.

Actions #16

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

Actions #17

Updated by Renato Botelho almost 8 years ago

  • Status changed from Assigned to Feedback

I believe it's all done now

Actions #18

Updated by Renato Botelho almost 8 years ago

  • Status changed from Feedback to Resolved

Everything looks OK now. Thanks Phil!

Actions

Also available in: Atom PDF