Currently states.js just adds a "form-required" class to the dependee form element when marking it as required.
With this patch, I propose to improve this by matching the appearance of a plain Forms API required field, by adding a themable marker at the end of the corresponding label, identical by default to that defined by theme_form_required_marker.

Files: 
CommentFileSizeAuthor
#6 match-states-api-required-736182-6.patch1.03 KBManjit.Singh
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 92,771 pass(es). View

Comments

sun’s picture

Status: Needs review » Needs work
+++ misc/states.js	8 Mar 2010 16:43:31 -0000
@@ -352,7 +352,12 @@ states.State.prototype = {
+        $(e.target).closest('.form-item, .form-wrapper').find('label *:last').remove();

This should select .form-required

Powered by Dreditor.

aspilicious’s picture

FileSize
1.17 KB
PASSED: [[SimpleTest]]: [MySQL] 20,302 pass(es). View

I tried this...

aspilicious’s picture

Status: Needs work » Needs review
nod_’s picture

Version: 7.x-dev » 8.x-dev
Status: Needs review » Needs work

This makes sense, please reroll against 8.x

nod_’s picture

Issue summary: View changes
Issue tags: +Needs reroll
Manjit.Singh’s picture

FileSize
1.03 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 92,771 pass(es). View

rerolling a patch :)

Manjit.Singh’s picture

Status: Needs work » Needs review
nod_’s picture

Issue tags: -Needs reroll
droplet’s picture

Version: 8.0.x-dev » 8.1.x-dev
Component: javascript » forms system
Issue tags: +JavaScript

Is it still an issue ? Steps to reproduce or a test module would help us to move it forward. Thanks.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

andypost’s picture

Assigned: peterpoe » Unassigned
Status: Needs review » Needs work

I think this issue should be refocused to make FAPI match required state set by states.js

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.