form.custom.widget.agreedPrice is the actual input widget for the field -- 
why do you want to use that as the HTML placeholder attribute? The 
placeholder attribute should just be some text you want to display in the 
field. If you want to display the default value, then just use something 
like db.mbs_sub_register.agreedPrice.default.

Anthony

On Monday, October 27, 2014 7:18:24 AM UTC-4, Annet wrote:
>
> I have the following field definition:
>
> Field('agreedPrice', type='double', default=0.00, 
> requires=[IS_FLOAT_IN_RANGE(0,256, dot=',', error_message='Format not of 
> type double')], notnull=True, label='Price in euro', writable=False, 
> readable=False),
>
> agreedPrice is set in a function:
>
> db.mbs_sub_register.agreedPrice.default = MICRO3PRICE
>
> where MICRO3PRICE = 32
>
> This works fine, except when I disable the field in a custom form:
>
> <div class="form-group">
>   <label for="mbs_sub_register.agreedPrice">Prijs p/mnd * </label>
>   <input class="form-control" id="disabledInput" type="text" 
> placeholder="{{=form.custom.widget.agreedPrice}}" disabled>
> </div> <!-- /.form-group -->
>
> This renders:
>
> <input id="disabledInput" class="form-control" type="text" value="32,00" 
> name="agreedPrice" form-control="" double="" placeholder="<input class="> " 
> disabled>
>
> whereas it should render:
>
> <input id="disabledInput" class="form-control" type="text" disabled="" 
> placeholder="32,00">
>
>
> placeholder="{{=form.custom.widget.agreedPrice}}" works well if the field 
> is of type string.
>
>
> Kind regards,
>
> Annet
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to