Thanks, but unfortunately that didn't work. {{ form=auth.register() my_extra_element = CAT('Agree to ', A('terms & conditions', _href="/legal/agreement/")), INPUT(_name='agree',value=True,_type='checkbox') form[0].insert(-1,my_extra_element)for label in form.elements('label'): label["_style"] = "display:none;"pass
placeholders = { "email": "enter a valid email address", "password": "be secure", "post code": "3434343-3434383", "validator": "captcha"}for input in form.elements("input[type='text']"): input["_placeholder"] = placeholders.get(input["_name"], "")pass =form}} (this is in my view; and yes, I should move it to a controller, but want to get it working first) On Thu, Aug 30, 2012 at 4:11 AM, Bruno Rocha <rochacbr...@gmail.com> wrote: > placeholders = { > "name": "fill in your name", > "email": "enter a valid email address" > } > > for input in form.elements("input[type='text']"): > input["_placeholder"] = placeholders.get(input["_name"], "") > > > On Wed, Aug 29, 2012 at 3:07 PM, Alec Taylor <alec.tayl...@gmail.com> wrote: >> >> Thanks, also would there be a loop I can add before that to set the >> placeholder of each input? >> >> On Thu, Aug 30, 2012 at 3:58 AM, Bruno Rocha <rochacbr...@gmail.com> >> wrote: >> > for label in form.elements('label'): >> > label["_style"] = "display:none;" >> > >> > >> > >> > >> > On Wed, Aug 29, 2012 at 2:47 PM, Alec Taylor <alec.tayl...@gmail.com> >> > wrote: >> >> >> >> How do I remove labels from forms? >> >> >> >> I want to use placeholders instead... >> >> >> >> (this is for the auth.register form) >> >> >> >> Thanks for all suggestions, >> >> >> >> Alec Taylor >> >> >> >> -- >> >> >> >> >> >> >> > >> > >> > -- >> > >> > >> > >> >> -- >> >> >> > > > -- > > > --