Now I used onclick to display the computed max doz, now I want it to auto compute after I input numbers in max lot. Is it possible?

The max_lot fields use the autocalearn() function, so the end of that function could trigger another function to perform your desired auto compute.

In regards to your code - wow! That's a boat-load of duplication in there.It is fairly easy to remove much of that duplication, such as all of the inline event attributes, and replace them entirely with something like this:

The max_lot fields use the autocalearn() function, so the end of that function could trigger another function to perform your desired auto compute.

In regards to your code - wow! That's a boat-load of duplication in there.It is fairly easy to remove much of that duplication, such as all of the inline event attributes, and replace them entirely with something like this:

You've managed to change things so that they are guaranteed to fail on all web browsers, regardless of what they support.

I suggest that we just go back to using a normal for loop and index, to manage the loops. Hopefully you might understand those better, when you don't also have to worry about your web browser incompatibilities.