Only arguments starting in _ get passed. You want

    return dict(form=FORM('business: ',INPUT(_id='keyword',
             _onkeyup="ajax('bg_find',
['keyword'],'target');"),_name='f1'),
             target_div=DIV(_id='target'))

On Feb 24, 3:43 pm, Jim <jdeib...@gmail.com> wrote:
> I'm attempting to usehttp://www.plus2net.com/html_tutorial/set-focus.php
> to set the focus to a search box for the user.
>
> However, I'm having problems because I can't pass the formname from
> the controller to the view.   I can set it on the controller side but
> it does not show up on the view side.
>
> In this 
> thread:http://groups.google.com/group/web2py/browse_thread/thread/9a8195752b...
>
> it seemed like there was a similar problem.
>
> controller fragment
>     return dict(form=FORM('business: ',INPUT(formname='widget',
> name='testit', _name='f1',_id='keyword',
>              _onkeyup="ajax('bg_find',['keyword'],'target');")),
>              target_div=DIV(_id='target'))
>
> view source on the page:
> <form action="" enctype="multipart/form-data" method="post">business:
> <input id="keyword" name="f1" onkeyup="ajax('bg_find',
> ['keyword'],'target');" /></form>
>
> I notice that "formname" and "name" don't get passed.
>
> For the javascript to work, it needs to have something like this:
>
> <form name=f1 action='' method=post><input type=text name=userid></
> form>
>
> Is there a way to do this that I'm missing?   Or does somebody have a
> better way to set focus?
>
> Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" 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