I checked out your web page. The way you did it, was implemented it with javascript code in html.
But What I did was implemented the answer in EJS, and the javascript code is used for sending data back to server and get user's record from the server. I tried to implemented it in a standard way. You can download the above EJS file and check out how I did it.

The following two methods were defined in the EJS, and the action for the [u]text field[/u] input is [b]checktime()[/b];
l_title is a String which will be displayed in the center of the simulation. The initial value is "";

public void checktime(){
if(!_isApplet() || server_control==0)
l_title=l_out1+dvalue(tmin)+l_out2+dvalue(Tmin)+ l_out3+ (100- (int)(Math.abs(Tmin-tmin)*100));
}
// _isApplet() is used to check if it were running as an applet. If it was not running as an applet (e.g. when you run it with EJS or click xxx.jar file directly to run it)
// server_control is another global variable defined, the initial value is 0.  Because user might have download the applet from our server and view the downloaded html file. The applet will be view locally (which was not connected to our server).
The above code to make sure user can run the simulation and find out the result when enter value into text field. But when it was running on our server, the String l_title will not be set (you can add whatever action you want).

public String ejs_commit(){
if(_isPaused() && t>0)checktime();
else l_title="";
return l_title;
}

The above function was defined so that it can be called directly from html with javascript. (You need to add mayscript="true" as part of applet tag. Check out the source code for this html and you will find the applet tag.

I add the button inside a form and add onclick function to call ejs_commit.
A javascript call was added (called when html is fully loaded) to set server_control to 1 so that l_title will be set to output when ejs_commit() was called.
Then I used AJAX to send result back to server and print out user's history records,too.

You can follow the above method on your server. There is a magic code you can add in this forum and the above javascript and forum will be added automatically. I can tell you via private message if you are interested. (Actually, you can find out how I did it, i.e. the secret code if you view my previous html source-- the one with the applet)