[html-formfu] Model::DBIC: label-style text field

Carl Franks fireartist at gmail.com
Thu Dec 18 13:23:16 GMT 2008


2008/12/18  <onken at houseofdesign.de>:
>
> On Wed, 17 Dec 2008 09:51:06 +0100, <onken at houseofdesign.de> wrote:
>> Hi,
>>
>> I want to create a shopping cart with formfu. Actually the dialog where
> you
>> see all your items and you can update the quantity of them. This is the
>> only editable field. As label I use the product title. But also want to
>> show the price and total. Both are avaiable from the row object.
>> If I add an element "- name: price" it renders an input field, which is
>> what we all expect. But I want it to be a simple label.
>> My dirty workaround:
>>
>> - name: price
>>   model_config:
>>     label: price
>>   attrs:
>>      style: "display: none"
>>
>> Well, this works but an attacker could easily fill in the hidden form
> field
>> and can change the price (bad!).
>>
>> Is there an element I could use?

There's no way to currently do it, while still using Model-DBIC to
populate the field.
Maybe adding a 'readonly' model_config() option would be the best solution?

Carl



More information about the HTML-FormFu mailing list