[twill] Why are hidden fields read-only?

Howard B. Golden howard_b_golden at yahoo.com
Sun Mar 25 11:06:45 PDT 2012


Ram,

From the mechanize FAQ:

How do I change INPUT TYPE=HIDDEN field values (for example, to emulate the effect of JavaScript code)?
As with any control, set the control’s readonly attribute false.
form.find_control("foo").readonly = False # allow changing .value of control foo
form.set_all_readonly(False) # allow changing the .value of all controls

HTH,

Howard


>________________________________
> From: Ram Rachum <ram at rachum.com>
>To: twill at lists.idyll.org 
>Sent: Sunday, March 25, 2012 10:43 AM
>Subject: [twill] Why are hidden fields read-only?
> 
>
>Hello,
>
>
>I'm using Twill and I tried to fill in a form which has a hidden field.
>
>
>Twill doesn't let me fill in the hidden field, saying it's read-only:
>
>
>    AttributeError: control 'user' is readonly
>
>
>Why is this? What's the problem with writing to a hidden field?
>
>
>
>
>Thanks for your help,
>Ram Rachum.
>_______________________________________________
>twill mailing list
>twill at lists.idyll.org
>http://lists.idyll.org/listinfo/twill
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/twill/attachments/20120325/f723921c/attachment.htm>


More information about the twill mailing list