It's up to you how you trigger/call the ajax() function -- if you want to
call it when a button is clicked, then add the call to the button's onclick
attribute. You don't have to specify any field -- just use [] for the
second argument.
Anthony
On Saturday, September 10, 2011 6:45:08 PM UTC-4, Ramos 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
>
>