My website features a signin()
button that I want to enhance with ajax functionality. When the button is clicked, I need it to update two divs: one displaying a personalized welcome message, and the other showcasing a statistics table in a different location. The actual signing-in process and welcome message are both handled by a function called signin()
, while the statistics table is generated by a function named statistics_table()
.
Currently, my button form includes the following:
<input type="submit" value="Sign In" onclick="return signin(); return statistics_table();"/>
However, this setup does not work as intended because only the first function is being executed due to the return statement breaking out of the operation. Since both functions contain their own return statements, how can I ensure that both functions are properly called when the button is clicked?
I attempted placing a call to the second function at the end of the first function (before the return statement), but encountered issues with this approach as well.