Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 835

Use it for questions about the Form API. Don't use it for entity or entity field forms.

2
votes
We have a client who runs a security scan that flags login forms that have autocomplete enabled, and have been using this solution for a few years now: /** * Implements hook_form_alter … (). * * Remove autocomplete from all user forms. * Based on http://www.midwesternmac.com/blogs/jeff-geerling/disabling-autocomplete-forms */ function MYMODULE_form_alter(&$form, &$form_state, $form_id) { if (strpos($form_id, 'user_') === 0) { $form['#attributes']['autocomplete'] = 'off'; } } …
answered Nov 6 '12 by mpdonadio
0
votes
Going under the assumption that this is Drupal 8 (based on the $node = $form_state->getFormObject()->getEntity(); line, you can do something like this: function demo3_form_alter(&$form, $form_state, …
answered Jan 4 '17 by mpdonadio
8
votes
Hiding the element is done during the rendering process. If you look at the code, it just marks the element as already being rendered. The #access key on the element is used during the form build pr …
answered Dec 10 '14 by mpdonadio
0
votes
To be honest, you best bet is to recreate the forms using the Webforms module. Unlike FAPI, you get a nice UI for making them, and several options for handling the form data once received …
answered Mar 14 '12 by mpdonadio
1
vote
1answer
I have content type with a taxonomy attached to it (since it is Drupal 8, it ends up being an Entity Reference field). The form is configured to render out this field input as checkboxes. I have run …
asked May 30 '17 by mpdonadio
2
votes
parent entity itself or as part of a view. Note I mentioned entities and not forms. The Datetime Range module does not provide any new form elements. The Widgets themselves are built around the …
answered Oct 23 '17 by mpdonadio
2
votes
The primary confusion around this is that the widgets (the code responsible for field input) for datetime, datetime range, and timestamp fields use HTML5 date/time input elements (except when using th …
answered Aug 21 '18 by mpdonadio
1
vote
I am pretty sure that the Menu Attributes module will work for you. It adds several options to the menu entries, including ID and class attributes. You would just need to edit the menu entries that …
answered Aug 9 '11 by mpdonadio
3
votes
The preprocess.inc and process.inc files are an Alpha/Omega way of organizing template_preprocess and template_process functions. Basically, if your template.php would have a mytheme_preprocess_node, …
answered Jul 17 '12 by mpdonadio
2
votes
When tasked with this like this, your best place to start is the API function that you know about, and start working backwards though the code until you find what you need. Take a look at the code fo …
answered Mar 26 '12 by mpdonadio
2
votes
3answers
I have a form that is using #autocomplete_path on a textfield. In general it works fine. Is there a way to have the autocomplete callback not fire until a minimum number of characters have been ente …
asked Jul 8 '13 by mpdonadio
2
votes
You can try out the Honeypot module. It basically adds a hidden field to your forms, and then makes sure it is empty upon submission. …
answered Sep 17 '12 by mpdonadio
3
votes
Sounds like you want to use the format_date() function. $now = time(); $date = format_date($now, 'short'); You can use it with any of the date formats that are defined in your system, or you can pa …
answered Jan 11 '13 by mpdonadio
3
votes
Users in Drupal 7 are proper entities and fieldable. Goto Administration » Configuration » People » Account settings » Manage Fields (admin/config/people/accounts/fields) Add a new Field. Choose a …
answered Apr 4 '14 by mpdonadio
2
votes
As others have suggested, there is a delay with AJAX autocomplete due to the server round trip. However, there is a delay baked into Drupal itself. In misc/autocomplete.js, there is this section of …
answered Oct 13 '15 by mpdonadio

15 30 50 per page