i have a problem regarding light box focus.. i have a button that whenever i click the button it will call the light box..

there are 2 function .

function focus_on_lightbox(seconds) {
  var seconds_waited
  seconds_waited = seconds
  document.getElementById(EducationBox).focus(); 
  seconds_waited += 100;

  if (document.getElementById(EducationBox) != document.activeElement && seconds_waited < 2000)
    setTimeout("focus_on_lightbox(" + seconds_waited + ");", 100);
  {
	  
  }
}
function OpenEducation() {
	
		document.getElementById("EducationBox").style.display = "inline";
		document.getElementById("FullScreen").style.display = "inline";
		
}
function CloseEducation() {
		document.getElementById("EducationBox").style.display = "none";
		document.getElementById("FullScreen").style.display = "none";
}

the code above are the 2 functions . one for light box and second is for lightbox focus

how can i call the lightbox focus.

i tried the code below. it will focus to the lightbox but it will not display the lightbox.

<div class="a"><div class="l">&nbsp;</div><div class="r"><input type="submit" value="Add" onclick='OpenEducation(); return false; focus_on_lightbox '/></div></div>

I don't know what else may be wrong (you have not provided enough to test) but in this statement onclick='OpenEducation(); return false; focus_on_lightbox ' nothing after "return false;" will ever be executed.

Start by moving that to the end of the onclick= string. You will then have to fix the rest of it to call 'focus_on_lightbox()' properly (if that is what you are trying to do).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.