‘#validated’ => ‘TRUE’ add this into your form elements definitions:
Example:
form['my_dynamic_select'] = array(
…
‘#type’ => ‘select’,
‘#validated’ => TRUE
…
)
Reason:
If we are using an input in AJAX related situation we will fill the input field like SELECT (dropdown) this error will shown in the interface. Because when a value is not present in the page load will not allowed in form submission time. So, the Drupal restricts this type of value. This value is considered as illegal value. Say for example an user can inject a set of value in our site and they can choose a particular value in it.
But our case is also same like injecting in sense of pushing a new set of values through AJAX. So now and then we need to used the form field attribute "validate as True", to get a Permanent and Perfect solution too.
Thanks.
Thank you very much !!
ReplyDeleteWell, this really helped me out solving an issue I'm having and trying to solve for 2days. Thanks.
ReplyDeletegreat job
ReplyDeleteThank you very much
ReplyDeleteLegend, Been looking at that damn error message for about 3 hours now. Thank you!
ReplyDeleteWhere to find the form element? Can you elaborate a bit more plz?
ReplyDeleteYes, where would we find this?
DeleteThx so much !! =)
ReplyDeleteIts working
ReplyDelete