After having read more than 30 post in google, about web2py and ajax that
have not been answered yet, I could find the way to answer my question.
Here is for help if someone have the same doubt.
in db.py
def card_name():
if request.vars.card != "":
query = db.cards(db.cards.card==request.vars.card)
return query.name+" "+query.firstname+" "+query.secondname
else:
return ''
In custom form:
....
{{=form.custom.begin}}
Card Number: {{=form.custom.widget.card}}
.....
<h4>Card name:<div id="target"></div></h4>
....
{{=form.custom.end}}
<script>
jQuery(document).ready(function(){
jQuery('#documents_card').change(function(){
ajax('card_name', ['card'], 'target');
});
});
</script>
El miércoles, 30 de julio de 2014 09:41:40 UTC-6, Leonel Câmara escribió:
>
> Eheheh don't read it with a tone, keep asking questions if you need help.
>
--
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.