Try INPUT(..., _readonly='readonly') -- I think that should work in most browsers. Note, when you use SQLFORM with a writable=False field, web2py simply displays the value by itself (i.e., not within an <input /> element), so you could try that approach as well.
Anthony On Wednesday, December 5, 2012 12:17:07 PM UTC-5, Francisco Barretto wrote: > > Third question is still open. How to set an text type input non-editable? > _disabled does not work. It always fails on validation, even with a default > valid value. > > Francisco Barretto > Doutorando PPG-Arte - Arte e Tecnologia > > Laboratório de Pesquisa em Arte Computacional (Midialab) > Departamento de Artes Visuais > Instituto de Artes > Universidade de Brasília - UnB > Campus Universitário Darcy Ribeiro > Asa Norte > 70910-900, Brasília - DF > > www.ciurbi.wordpress.com > www.wikinarua.com > www.tectecbaratinha.wordpress.com > www.flickr.com/photos/meiotijolo > > > 2012/12/5 Francisco Barretto <[email protected] <javascript:>> > >> Anthony, you're right! >> >> Francisco Barretto >> Doutorando PPG-Arte - Arte e Tecnologia >> >> Laboratório de Pesquisa em Arte Computacional (Midialab) >> Departamento de Artes Visuais >> Instituto de Artes >> Universidade de Brasília - UnB >> Campus Universitário Darcy Ribeiro >> Asa Norte >> 70910-900, Brasília - DF >> >> www.ciurbi.wordpress.com >> www.wikinarua.com >> www.tectecbaratinha.wordpress.com >> www.flickr.com/photos/meiotijolo >> >> >> 2012/12/5 Anthony <[email protected] <javascript:>> >> >>> If you want a <textarea> element, then don't use INPUT(_type='textarea')-- >>> instead it should be >>> TEXTAREA(). Once you do that, hitting enter will insert a line break >>> rather than submit the form, and you'll be able to set the columns and rows >>> if you don't like the default size. >>> >>> Anthony >>> >>> >>> On Wednesday, December 5, 2012 8:46:16 AM UTC-5, Francisco Barretto >>> wrote: >>>> >>>> Hi there, it might be (and probably is) a silly but I have a series of >>>> questions concerning the following form: >>>> >>>> form=FORM(TABLE(TR("Nome:",INP**UT(_type="text",_name="name", _value= >>>> user_name, _writable=False, requires=IS_NOT_EMPTY())), >>>> >>>> TR("Email:",INPUT(_type="text"**,_name="email",_value >>>> =user_email, _writable=False, requires=IS_EMAIL())), >>>> TR("Message:",INPUT(_type="**textarea",_name= >>>> "message", requires=IS_NOT_EMPTY())), >>>> #TD(Recaptcha(request,__conf__**.public_key(), >>>> __conf__.private_key())), >>>> TR(TD(), TD(INPUT(_type="submit", _value="Send" >>>> ),INPUT(_type="**button",_value="Cancel",_**onclick= >>>> "javascript:history.**go(-1);"), INPUT(_type="button",_value="**Clear", >>>> _onclick="this.form.**reset();"))))) >>>> >>>> >>>> 1) How can I set the number of rows and columns of a textarea in a >>>> regular form? >>>> 2) How can I allow lines breaks ( \n ) in a textarea field? Actually >>>> when I hit enter, it submits the form. >>>> 3) How can I set an input textfield as non-writable? '_writable=False' >>>> doesnt work >>>> >>>> Thanks! >>>> >>>> >>>> >>>> >>>> -- >>> >>> >>> >>> >> >> > --

