|Stuck with symfony forms [message #103187]
||Wed, 28 July 2010 13:19
Registered: July 2010
Hi, I have just started using symfony (1.4), and stuck at first actual form on my site |
I have some registered users in database. They can edit their profile details except some details which can only be edited by users with more access rights.
I am using Doctrine, the models and forms are built based on schema.
I want to display fields which can't be modified as read only. Now, read only works fine with text fields, but it can't be used with <select> rendered by sfWidgetFormChoice.
If I disable the <select> rendered by sfWidgetFormChoice, the values are not submitted and form validation fails.
I also tried few other things like not showing the un-editable fields at all, but then again the form is not validated.
Thought to add hidden fields for each <select> with the selected value, but don't know how can I get names and values of form widgets i.e. sfWidgetFormChoice in my template.
Can anyone please guide me how can I get the desired behaviour. I am sure their would be some way, I tried googling but didn't get any useful results.