[development] Forms API #id questions

Karoly Negyesi karoly at negyesi.net
Sun Jan 15 10:18:42 UTC 2006

On Sun, 15 Jan 2006 11:04:45 +0100, Robert Douglass <rob at robshouse.net>  

> I'm in the habit of giving nearly every form element an #id because I've  
> been doing lots of AJAX stuff and always have the need to grab things in  
> the DOM. Can someone comment on this bit of instruction:
> http://drupaldocs.org/api/head/file/contributions/docs/developer/topics/forms_api_reference.html#id
> Is the use of #id discouraged?

For your convinience, it's automatically created from #parents which again  
autocreated from #tree. But if you do not like this autocreated #id , feel  
free to provide your own, form API will honor it.

> Why is there no #id property allowed on hidden form elements?

Feel free to roll a patch against theme_hidden.

More information about the development mailing list