I had a "duh" moment and realized a simple solution: foreach ($form->getFormFieldSchema() as $fieldName => $field):
That gets me the field name I'm after. So, nothing to see here, move along :) Jonathan wrote: > I have a scenario where I need to be able to modify a form label's > content dynamically, which means getting a reference to the label via > JS. The problem is that symfony forms generated labels don't have ID > attributes. I can manually add an ID attribute, but in my case I don't > know what ID to give to the label since I am looping through and > displaying my form elements via foreach ($form->getFormFieldSchema() > as $field): > > So, two questions: How can I get the name or id of my formfield/ > widget? It doesn't seem to be available. If I cannot get this than I > can't manually build up my label id which leads to my second question > - is it at all possible to get a reference to my label via JS without > it having an ID? > > thanks > jonathan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---
