Go back to your button's Html Element Properties and open the code box.
Change your code to the following:
$eb.executeFunction('add', null, true, true);
What this is now saying is:
- Execute the add function
- Don't pass any parameters
- Automatically refresh the page with any changes resulting from the executed function
- Submit all of the data on the page to the server before executing the function
This means that whatever values we enter into f1 and f2 will be updated on the server before the function executes. It also means that the value of f3 will be automatically updates on the browser page once the function completes.