_onkeyup="ajax('%s',['keyword'], 'target');" %
URL(r=request,f='get_info'))),

should be

_onkeyup="ajax('get_info',['keyword'], 'target');")),

On May 23, 6:31 am, Zhe Li <[email protected]> wrote:
> Hi,
>
> There seems to be an issue with submission AJAX data in form.
>
> Remove welcome and example applications first and make a new app
> called init.
>
> Again I was using this example:
>
> default.py
> -------------------------
> def index():
>     response.subtitle = ''
>     return dict(form=FORM('username', INPUT(_id='keyword',
>                                            _onkeyup="ajax('get_info',
> ['keyword'], 'target');")),
>                 target_div=DIV(_id='target')
>
> def get_info():
>     print(request.vars.keyword)
>     pattern = '%'+ request.vars.keyword + '%'
>     pages = db(db.members.username.like(pattern)).select()
>     items = [A(row.username, _href=URL(r=request, f=index,
> args=row.id)) for row in pages]
>     return UL(*items).xml()
>
> index.html
> ----------------------------
> {{extend 'layout.html'}}
> {{=form}}<br />{{=target_div}}
>
> now if you visithttp://localhost:8000it never works.
> but if you visithttp://localhost:8000/init/default/indexit does.
>
> Is it a bug?
>
> Cheers,
> Zhe

Reply via email to