[web2py] Re: placeholder="{{=form.custom.widget.agreedPrice}}"
Yes, the problem is not with using the placeholder attribute -- it's just with what you put in there. On Monday, October 27, 2014 8:34:02 AM UTC-4, Annet wrote: > > Hi Simone and Anthony, > > Thanks for your replies. > > I wanted to style this custom form the Bootstrap 3 way: > > http://getbootstrap.com/css/#forms-control-disabled > > That's why I use the placeholder attribute. > > Using db.mbs_sub_register.agreedPrice.default as the placeholder soves the > issue. > > > Best, > > 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.
[web2py] Re: placeholder="{{=form.custom.widget.agreedPrice}}"
Hi Simone and Anthony, Thanks for your replies. I wanted to style this custom form the Bootstrap 3 way: http://getbootstrap.com/css/#forms-control-disabled That's why I use the placeholder attribute. Using db.mbs_sub_register.agreedPrice.default as the placeholder soves the issue. Best, 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.
[web2py] Re: placeholder="{{=form.custom.widget.agreedPrice}}"
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: > > > Prijs p/mnd * >placeholder="{{=form.custom.widget.agreedPrice}}" disabled> > > > This renders: > > name="agreedPrice" form-control="" double="" placeholder=" disabled> > > whereas it should render: > > 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.
[web2py] Re: placeholder="{{=form.custom.widget.agreedPrice}}"
form.custom.widget.whatever is a widget, not a value. On Monday, October 27, 2014 12:18:24 PM UTC+1, 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: > > > Prijs p/mnd * >placeholder="{{=form.custom.widget.agreedPrice}}" disabled> > > > This renders: > > name="agreedPrice" form-control="" double="" placeholder=" disabled> > > whereas it should render: > > 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.