5. Basic AJAX in QForms
Hello World Example using AJAX
<< Previous   |   Back to Main   |   Calculator Example using AJAX >>

View Source
will open in a new window
Hello World, Revisited
This example revisits our original Hello World example to show how you can easily change a postback-based form and interactions into AJAX-postback based ones.

Whereas before, we executed a QServerAction on the button's click, we have now changed that to a QAjaxAction. Everything else remains the same.

The result is the exact same interaction, but now performed Asynchronously via AJAX. Note that after clicking the button, the page doesn't "refresh" -- but the label's contents changes as defined in the PHP method btnButton_Click.

Click the button to change my message.