The "crazy" need not be that crazy. I normally do:

  db.Field('myfield','string',
    widget=lambda field,value,**kwargs:
      StringWidget.widget(field,value,_size=40,**kwargs)

so that the output field has a size=40 setting.

css should also work. Just make sure your definition appear in right
place so that it won't be override by default setting.

On Oct9, 1:15pm, "mr.freeze" <nat...@freezable.com> wrote:
> Try using the class:
>
> input.string {
>     width: 450px;
>
> }
>
> or if you don't want to affect all input.string:
>
> #mytable_myfield{
>     width: 450px;
>
> }
>
> or go crazy...
>
> db.define_table('mytable',Field('myfield','string'))
> db.mytable.myfield.widget = lambda f,v: INPUT(_type="text", _value=v,
> _class="crazy_input",_name="myfield",_id="mytable_myfield",
> _size="100")
>
> On Oct 8, 11:40 pm, leone <handja...@gmail.com> wrote:
>
>
>
> > I know, but no effect. Strange.
> > Do you know if SQLFORM's argument onvalidation is executed before
> > inserting row?
>
> > On 8 Ott, 22:51, Thadeus Burgess <thade...@thadeusb.com> wrote:
>
> > > leone,
>
> > > To change the size in css you have to use the width property, there is no
> > > "size" property in css.
>
> > > input #table_field {
> > >     width: 350px;
>
> > > }
>
> > > -Thadeus
>
> > > On Thu, Oct 8, 2009 at 3:07 PM, leone <handja...@gmail.com> wrote:
>
> > > > Second question solved.
> > > > About input length css has no effect.
> > > > SQLFORM(onvalidation is executed before or after inserting row?
>
> > > > On 8 Ott, 17:23, Thadeus Burgess <thade...@thadeusb.com> wrote:
> > > > > massimo,
>
> > > > > On my machine locally, web2py_ajax.html seems to overwrite any length
> > > > > settings put into css..
>
> > > > > The jQuery commands that change the length need to be either commented
> > > > out
> > > > > or removed.
>
> > > > > -Thadeus
>
> > > > > On Thu, Oct 8, 2009 at 8:07 AM, mdipierro <mdipie...@cs.depaul.edu>
> > > > wrote:
>
> > > > > > You should set it using css. For a table "table" and a field "field"
> > > > > > the id of the input field is
>
> > > > > > "#table_field"
>
> > > > > > you should be able to do something like this in the page
>
> > > > > > <style>
> > > > > > input #table_field { size: 5 }
> > > > > > </style>
>
> > > > > > On Oct 8, 8:01 am, leone <handja...@gmail.com> wrote:
> > > > > > > Two questions:
> > > > > > > 1) how can I set the length of an html input field generated by
> > > > > > > SQLFORM? They have all the same size.
> > > > > > > 2) It  needs same commit() using SQLite? My submits seem to 
> > > > > > > generate
> > > > > > > no rows.
>
> > > > > > No need for commit. Do you have form.accepts(...)? Hard to tell the
> > > > > > problem without looking at the action.
>
> > > > > > > Thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to