View Full Version : continuously testing

08-22-2012, 10:39 AM
Not to sure what to do say but here it goes. I am trying to test when a certain part of my page is in focus to display a message box. Here is the page http://yftg.ca/Untitled-5.html.
I would like this code to running at all times when on this page.

if(Element.tabIndex = 27)
if(document.getElementById("entry_53").value > 30)
var ade = document.getElementById("entry_53").value - 30;
alert( "Please Deposit " + ade);

What this code is suppost to do is when the table Amount in Deposit Envelope is in focus or the cursor is in the first box of that table a message box pops up telling the user what the total of that table is supposed to be. If there is a better way to do this I would be grateful for your help thank you.

08-22-2012, 03:24 PM
Without looking at the particulars, I can tell you that:

There is no field labeled "table Amount".

if(Element.tabIndex = 27)
is always true as long as Element exists. Perhaps you mean:

if(Element.tabIndex == 27)
which is only true if Element.tabIndex equals 27.

If you want something continuously checked, you need an interval or a looping timeout.

If you alert continuously, it will be very distracting, rendering the page virtually useless.