<script type="text/javascript" charset="utf-8">
    $(document).ready(function() {
        $("input#YourSelectFieldId").focus(); // not required
        $("button[type=submit]#ButtonSubmitId").hide();
        $('form select[name=YourSelectFieldId]').on('change', function() {
            //alert($('select[name=YourSelectFieldId]
option:selected').val()); // For testing
            $("button[type=submit]#ButtonSubmitId").submit();
            });
    });
</script>


On Tue, Feb 18, 2014 at 7:24 AM, horridohobbyist
<[email protected]>wrote:

> I have a SQLFORM.grid that allows the user to select a query from a
> selection of queries. The user selects the query using this form:
>
> FORM(TABLE(TR(T("Choose Category:"),SELECT([my_list
> ],_name='category',value=current)),
>            TR("",INPUT(_type='submit'))))
>
> The grid is:
>
> SQLFORM.grid(query,
>     orderby=db.products.category,
>     csv=False)
>
> I would like the user to not have to click on a submit button. I just want
> to have some action that will modify the grid query as soon as the
> selection is made. What's the best way to do this? (I can think of a very,
> very messy way, but I'd like to avoid that.)
>
> Thanks.
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to