Hi Jim,

Just got a minute... I use something like this to scroll to and highlight 
the first field in a long form (but not within a Collapse structure).   Off 
the top of my head, you're submitting to web2py, so in the controller:

if form.process().accepted:
    <all good>
elif form.errors:
    focus_field = next(iter(form.errors.keys()))

return dict(........., focus_field=focus_field)


then, in the view:

    {{ if focus_field: }}
        <script>
            $(function() {
               $("[name='{{=focus_field}}']").focus();
            });
        </script>
    {{pass}}

Could something like that work in your case? On field focus, does the 
collapse open automatically?

HTH,

Jose





How about in your controller,

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/d189309d-a7e4-4fac-a007-02412532c1cco%40googlegroups.com.

Reply via email to