Hello,
I would improve default search widget a bit like that :
if expert_search:
search_widget = lambda sfield, url: CAT(FORM(
TEXTAREA(_name='keywords',
_class='expert_search',
_value=request.vars.keywords,
_id=skeywords_id,
_onfocus=
"jQuery('#%s').change();jQuery('#%s').slideDown();" % (spanel_id, sfields_id
) if advanced_search else ''
),
INPUT(_type='submit', _value=T('Search'), _class="btn
btn-default"),
INPUT(_type='submit', _value=T('Clear'), _class="btn
btn-default",
_onclick="jQuery('#%s').val('');" %skeywords_id
),
_method="GET", _action=url), search_menu)
else:
search_widget = lambda sfield, url: CAT(FORM(
INPUT(_name='keywords',
_value=request.vars.keywords,
_id=skeywords_id,
_onfocus=
"jQuery('#%s').change();jQuery('#%s').slideDown();" % (spanel_id, sfields_id
) if advanced_search else ''
),
INPUT(_type='submit', _value=T('Search'), _class="btn
btn-default"),
INPUT(_type='submit', _value=T('Clear'), _class="btn
btn-default",
_onclick="jQuery('#%s').val('');" %skeywords_id
),
_method="GET", _action=url), search_menu)
So the search query is easier to write for an "expert"...
But I didn't find where the search form get parsed... We need to strip line
break of the textarea in order to have this feature.
Thanks
Richard
--
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/d/optout.