I do not understand. If you want to call an action, get the output and
then send it via ajax you can do
<input type="hidden" name="tmp"/>
<button onclick="jQuery('#tmp').val(process());ajax('...',
['tmp'],'target');">click me</button>
<div id="target"></div>
On Sep 10, 5:45 pm, António Ramos <[email protected]> wrote:
> Hello,
>
> the ajax function example in the web2py book
>
> ajax('{{=URL('new_post')}}',['your_message'], 'target');
>
> sends the value of the field *your_message* to the controller function
>
> I dont want to send the value of a field but a button onclick action
>
> My webpage can have 2,4 10 or 20 buttons. It depends . And each time i press
> a button i need to call the ajax function to process that button
>
> can the ajax function process a button instead of a text field?
>
> Thank you