I haven't included any error checking to check if numbers were entered.

`

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

`

Kalon, many thanks for your code. Your code is working great. But as you entered fieldset tag in the form,the 2 input boxes look different from the 3rd one. Is there anyway, with which all input boxes will look same like a simple form but also will work correctly like your code?

Kalon, many thanks for your code. Your code is working great. But as you entered fieldset tag in the form,the 2 input boxes look different from the 3rd one. Is there anyway, with which all input boxes will look same like a simple form but also will work correctly like your code?

Thanks

as pmw57 said, the only purpose of the fieldset in my demo code is to make it easier to get the 2 input element objects. I could have just as easily used a div.

normally, unless I had to wrap ths inputs for another purpose I would have just given them a class name and then used a customised getElementsByClassName() function to get the 2 input elements. but that means a little more code and I wanted to keep the demo as simple as possible.