简体   繁体   中英

Drupal how to add form validate true to a form

I am getting

"An illegal choice has been detected. Please contact the site administrator."

when I am trying to give term which doesn't exist in select box filter. I added validate true to the form_alter function for the particular its working and returning all data.How to add it dynamically without specifying the field name in the function.

$form['field_industry']['#validated'] = TRUE;

Else Is there any option to add form validate true in views

Thanks in advance

I got this message when trying to select certain Industries in a list. Some Industries worked, some generated the "illegal choice" message. The problem turned out to be that some Industry names had ampersands in them and others didn't. When I changed the ampersands to "and" that fixed it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM