Re: Hidden required select field with default value

David Metzler <[email protected]>
Newsgroups gmane.comp.php.drupal.devel
Message-ID <[email protected]>
Try taking the value from #default_value and putting it in #value.  

Sent from my iPhone

On Nov 11, 2011, at 7:50 AM, "Idan Arbel" <[email protected]> wrote:

> Hello,
>  
> I’m trying to modify a form where I’m hiding a select field.
>  
> This field is usually required.
>  
> When setting the #type = hidden
> The field is hidden, but when trying to submit the form I get an error about the fields being required.
> Looking at the $form dump, I see that the select field has a default value. (a term id).
> I tried changing the Required to false when hiding but then the field looses its value.
>  
> Is there some other property I need to set?
>  
> Thanks
>  
> Idan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.