Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

continuously testing

Status
Not open for further replies.

jackfusion

Programmer
Aug 28, 2007
3
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 [URL unfurl="true"]http://yftg.ca/Untitled-5.html[/url].
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.
 
[ol]
[li]There is no table, only as series of DIV's there. [/li]
[li]Having it popup an alert while in focus will prevent any actual interaction of the page as Alerts pause the action from the page until you click on the alert's button to dismiss it, so if the alert keeps popping up continuously the user will not be able to interact with the page. [/li]
[li]If this should only happen once when the first box is focused, then that is easily accomplished with a function set to run on the onfocus event of the first box. [/li]
[/ol]

HTML:
    <div class="ss-item  ss-text">
                    <div class="ss-form-entry">
		    <input type="text" name="entry.82.single" size="10" value="0" class="ss-q-short" id="entry_82" tabindex="41" 
                    onchange="runtotalade()" [b][COLOR=#770000]onfocus="showPopup();"[/color][/b]>
                    </div>
                </div>

Code:
[b]function showPopup()
{[/b]
[COLOR=#0066DD]   if(Element.tabIndex = 27)
   {
	if(document.getElementById("entry_53").value > 30)
	{
		var ade = document.getElementById("entry_53").value - 30;
		alert( "Please Deposit " + ade);
	}
  }[/color] 
[b]}[/b]

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
I have tried it with onFocus but as you had said user is unable to do anything because the message box keeps popping up when the first box is in focus. Is there another way to work around this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top