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.
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.
It looks like you're just missing how to trigger the message. You could use the onFocus method to trigger a function that displays the msg, when that particular input is focused on.
Code:
var input = document.getElementById('idOfInputHere');
input.onFocus = displayMsgOnFocus(input.id);
function displayMsgOnFocus(elementId)
{
if(elementId == inputIdYouWantToTarget)
{
alert( "Please Make a Deposit");
}
}
FYI: that is just an idea to get you going, not a complete solution.
I have tried it with onFocus but 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?
Bookmarks