Skip to main content

Timeline for Unset fields as required for a Form

Current License: CC BY-SA 3.0

7 events
when toggle format what by license comment
Jun 3, 2014 at 11:12 vote accept Jago
May 30, 2014 at 17:40 comment added Pushpinder Rana I also tested this code at my end it works for me after clearing cache. I am sure it would also work for you, can you share your complete module code with me. And also confirm you are using correct form field name. If still you find issue with this, then please share your code I would fix this for you.
May 30, 2014 at 8:52 comment added Jago I am adding to hook_form_FORM_ID_alter() the following: $form['card_holder_name']['#required'] = FALSE; but it does not seem to work. I always get the message that the field is still required...
May 30, 2014 at 5:01 comment added Jago Ok, fair enough. Can you point me to some good example of usage of this? The module is already developed, I just need to locate where and how to use the function. So, can you provide a good example of usage? Thanks
May 29, 2014 at 13:37 comment added Pushpinder Rana @Jago first you look into api.drupal.org/api/drupal/modules!system!system.api.php/… and keep in mind never change in db directly there are number of options available to deal with such type of options. In your case you create custom module, create hook_form_alter and print the $form array and then do override respective fields as I suggested. You simply make field optional to avoid validation issue. Once you do all this stuff then share your code with us, if problem persists.
May 29, 2014 at 11:10 comment added Jago I am afraid I am a bit newbie for your answer... I would need something more like "go to this table in MySQL, search for X in field F and set 'required' to FALSE"... Either in the MySQL or in the Drupal admin panel. But I would definitely disable for all users.
May 29, 2014 at 10:36 history answered Pushpinder Rana CC BY-SA 3.0