ajax - web2py FORM customisation -


is possible use form.custom.### in forms not created sqlform class. instance want make custom form so:

form = form(             label('select search option', _for='search_option'),             select(__name='search_option', _onchange="jquery('props_ajaxholder').empty(); web2py_component(jquery(this).val(), 'props_ajaxholder');", *[option(search_options[so], _value=so.lower().strip() + '.load') in search_options]),         _id='matchingform',formstyle='table2cols') 

in view, want customise this, can insert <div id='placehlder'></div> between select , submit button. submit button shown once option selected.

you cannot use form.custom form. if want use it, build form sqlform.factory instead.

if need use form, can wrap div around elements when creating form.

form = form(             div(                 label('select search option', _for='search_option'),                 select(__name='search_option', _onchange="jquery('props_ajaxholder').empty(); web2py_component(jquery(this).val(), 'props_ajaxholder');", *[option(search_options[so], _value=so.lower().strip() + '.load') in search_options]),                 input(_type='submit',_value='submit!', _class="hidden"),                 _id="placehlder"),             _id='matchingform',formstyle='table2cols') 

showing/hiding submit button can done jquery/css.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -