Stephane Kanschine ha scritto:
> Hello,
>
> I try to offer my users an edit form on an ordinary object, but i
> don't want them to modify some fields. These TextField are displayed
> for information purpose, but disabled=True. From this point, it's just
> impossible to validate the form (Missing Value even without any
> validator). I read on old posts, that the browser doesn't send
> disabled input data, so the error_handler cannot retrieve the data and
> can't display them in case of error.
>
>   

I've solved this problem with this simple Widget:

class TextLabel(widgets.TextField):
    template = """
                  <div xmlns:py="http://purl.org/kid/ns#"; >
                    <label class="${field_class}"
                           py:content="value"
                           py:attrs="attrs"
                    />
                    <input type="hidden"
                           name="${name}"
                           id="${field_id}"
                           value="${value}"
                    />
                  </div>
               """

You have a lable for show the value and an hidden field for retrieve 
back the value.


Glauco


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to