I am in the process of writing an programmable RPN calculator in javascript.
You can view the abbreviated version at: [URL=http://www.nova.edu/~rumsey/JS/CalcTest.html]www.nova.edu/~rumsey/JS/CalcTest.html
The more extensive version has the same problem, both act differently with different browsers. For example:
? With NS-7 and FF:
Entering numbers from keyboard into the upper left text box works OK until you use the “Enter/Return” key on the keyboard. The value disappears from the textbox, the stack is either cleared or drops the top value and SOMETIMES an error is reported in the ‘javascript:’ console.
? With IE-6:
Entering numbers from keyboard into the upper left text box works OK until you use the “Enter/Return” key on the keyboard. Then nothing happens. No errors, no actions, nothing.
? For both versions of the problems above, I can continue by clicking on the “Enter” button, or any other button and all works as expected
All the button actions work correctly for both browsers:
You can verify this by using only the buttons for calculations or click on “Test Setup” to fill the stack box followed by the following sequence:
Click gives Results on top of stack
+ gives 70.00
– gives -50.00
x gives -500.00
/ (divide) gives 0.40
You can select the ‘inverse’ option from the select list:
value inverse gives 2.50
I get no errors when I use the buttons of the form, but different errors with the “Return/Enter” key on the keyboard. To make matters worse, I get very little in the way of information as to what it is doing when it is not doing anything.
The more extensive version of the program is located at: [URL]http://www.nova.edu/~rumsey/JS/CalcList.html
but it has the same problems as the abbreviated version when entries from the keyboard are followed by the “return/enter” key of the keyboard.
Can anyone explain what is happening here and how I correct it?
I hate to give up on this project when it is so close to being finished.
I have some other ideas that I want to add to the program, but until I can get past the problem stated above I don’t want to further add to MY confusion.
?