Your last post did answer my question, though, the code didn't work.
<button onclick="{{=URL(r=request,f='sayhi')}}">click me</button>
when you click it will call the action sayhi(), For example
def sayhi(): return dict(message="hello")
The button does not redirect to the other page when clicked...
On Apr 5, 7:04 am, mdipierro <[email protected]> wrote:
> The book on lulu.com should cost $12.
>
> On Apr 5, 5:03 am, Steve Shepherd <[email protected]> wrote:
>
> > Where did you find the book in pdf format for under $20?
> > You should look at the the following code that allows a callback without
> > updating the page. This would be great for a calculator.
>
> >def index():
> > button1=TAG.BUTTON(_onclick="$.ajax({url: '%s', success: function
> > (value) { $('#target').html(value); } });" % URL
> > (r=request,f='callback'))
> > div1=DIV(_id='target')
> > return dict(button1=button1, div1=div1)
>
> > class callback():
> > return H1('Hello world').xml()
>
> fixed a typo in code above.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---