Annet,
On Apr 9, 4:54 am, [email protected] wrote:
> Denes,
>
> I adjusted the form: type='integer' and _type='integer'
Only the first one needed adjustment.
>
> form=form_factory(SQLField('postcoderegio',type='integer',
> requires=IS_NOT_EMPTY(),\
> widget=lambda self,value:TAG[''](INPUT
> (_id='byzipcode',_name='postcoderegio',_class=\
> 'ac_input',_type='integer'))))
so this should read:
'ac_input',_type='text'))))
_type here refers to the TYPE of the HTML INPUT element.
( I use the reference from www.htmlhelp.com/distribution/ )
>
> and the handler in /core/handlers/: db.zipcoderegions.region.like('%d%
> %'%q) and r='%d%d\n'%(r,row.region)
>
> def byzipcodeAC():
> q=''
> if request.vars:
> q=request.vars.q
> if not q:
> return q
> rows=db(db.zipcoderegions.region.like('%d%%'%q)).select
The problem here is that zipcoderegions.region is an integer field in
the db and aside from maybe sqlite I don't think you can use LIKE on a
non-string field.
> (db.zipcoderegions.region)
> r=''
> for row in rows:
> r='%d%d\n'%(r,row.region)
> return r
>
> But the auto-complete still isn't working, i.e. when I type a number
> e.g. 7 the auto-complete results (71, 73, 74 etc) don't show up.
>
> Is it the 'n' in r='%d%d\n'%(r,row.region) or something else?
>
> Kind regards,
>
> Annet.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---