Results 1 to 2 of 2

Thread: continuously testing

  1. #1
    Join Date
    Jul 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default continuously testing

    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.
    Code:
    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.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Without looking at the particulars, I can tell you that:

    1. There is no field labeled "table Amount".

    2. Code:
      if(Element.tabIndex = 27)
      is always true as long as Element exists. Perhaps you mean:
      Code:
      if(Element.tabIndex == 27)
      which is only true if Element.tabIndex equals 27.

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

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

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •