Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
af97e790
Commit
af97e790
authored
9 years ago
by
Alex Pott
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2486993
by metzlerd, jhodgdon: Document Hidden Form Elements
parent
83054ca9
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/lib/Drupal/Core/Render/Element/Hidden.php
+13
-0
13 additions, 0 deletions
core/lib/Drupal/Core/Render/Element/Hidden.php
core/lib/Drupal/Core/Render/Element/Value.php
+11
-3
11 additions, 3 deletions
core/lib/Drupal/Core/Render/Element/Value.php
with
24 additions
and
3 deletions
core/lib/Drupal/Core/Render/Element/Hidden.php
+
13
−
0
View file @
af97e790
...
...
@@ -12,6 +12,19 @@
/**
* Provides a form element for an HTML 'hidden' input element.
*
* Specify either #default_value or #value but not both.
*
* Properties:
* - #default_value: The initial value of the form element. JavaScript may
* alter the value prior to submission.
* - #value: The value of the form element. The Form API ensures that this
* value remains unchanged by the browser.
*
* Usage example:
* @code
* $form['entity_id'] = array('#type' => 'hidden', '#value' => $entity_id);
* @endcode
*
* @see \Drupal\Core\Render\Element\Value
*
* @FormElement("hidden")
...
...
This diff is collapsed.
Click to expand it.
core/lib/Drupal/Core/Render/Element/Value.php
+
11
−
3
View file @
af97e790
...
...
@@ -10,9 +10,17 @@
/**
* Provides a form element for storage of internal information.
*
* Unlike \Drupal\Core\Render\Element\Hidden, this information is not
* sent to the browser in a hidden form field, but is just stored in the form
* array for use in validation and submit processing.
* Unlike \Drupal\Core\Render\Element\Hidden, this information is not sent to
* the browser in a hidden form field, but only stored in the form array for use
* in validation and submit processing.
*
* Properties:
* - #value: The value of the form element that cannot be edited by the user.
*
* Usage Example:
* @code
* $form['entity_id'] = array('#type' => 'value', '#value' => $entity_id);
* @endcode
*
* @FormElement("value")
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment