you must create widgets that support the placeholder attribute if you want to use form.custom.widget....
custom forms help you to place labels, comments, error messages and input fields within the page, but the "max granularity" (aka the greater detail level) of form.custom.widget.field is a ready-to-be-used INPUT (or SELECT, etc). Don't know if it's the best english way to explain, but you are trying to have a custom placeholder attribute *within* form.custom.field.widget, vs something *around* it. However, given that form.custom.widget.field is just an INPUT(), it can be customized as always acting on its keywords def test(): form = SQLFORM.factory(Field('test')) return dict(form=form) {{extend 'layout.html'}} <h1>Original form</h1> {{=form}} <h1>Custom form</h1> {{=form.custom.begin}} {{wdg = form.custom.widget.test}} {{wdg['_placeholder'] = 'hello world'}} ready? go! {{=wdg}} {{=form.custom.end}} On Tuesday, December 18, 2012 10:31:35 PM UTC+1, encompass wrote: > > I am trying to use existing theme classes and other attributes but can't, > for the life of me, figure out how to properly do it. > He is what I have in HTML, and if someone can tell me how to do with with > SQLFORM or SQLFORM.factory, I would greatly appreciate it. > I tried just doing the inputs with .custom and couldn't get that to work > with things like placeholder attributes and so forth. :/ Horrible baffled > as the documentation wasn't clear enough there on how to make it happen. > I would like to do as much of this stuff in the view as this is view > stuff. I think it's weird to be formating in the model if we can put it in > the view instead. > > I have this as my code in normal HTML5: > > <form action="{{=URL('default', 'index')}}" method='get'> > <div class="button_bg"> > <input type="text" name="site" class="span3 subscribe_input" size="24" > type="text" placeholder="Enter site url"> > </div><!-- end .button_bg --> > > <div class="button_bg"> > <input type="text" name="email" class="span3 subscribe_input" size="24" > type="text" placeholder="Your email"> > </div><!-- end .button_bg --> > <div class="button_bg"> > <button class="btn btn-large subscribe_button" type="submit">Send me the > results!</button> > </div><!-- end .button_bg --> > </form> > > BR, > Jason Brower (the confused.) > > --