Simple form submit without a page refresh

Hi All.

Apologies for any repetition but I’m after a very basic way to submit a numerical form input field without refreshing the HTML page I’m using. It’s a simple project at home on iis with the simple purpose of helping my boy learn his time tables. It doesn’t need any input validation etc. All I want him to have to do is type the numbers (the input box autofocus’s) and hit enter. It doesn’t need or require a button. But I would like to be able to display on-screen how many simple sums there have been. How many he got right and how many he got wrong etc. I can do most of it, but every time I submit the form it resets the variables to zero. I have little (as in almost zero experience with JS) I know a little PHP, but it won’t do what I want, I think. Any help would be greatly appreciated.

PHP is capable of handling this ($_SESSION variables…)
You can submit a form Asynchronously with Javascript as well.

A Theory Introduction to AJAX
An Example that’s close to your use case

2 Likes