Code:
if (document.getElementById('layer_s').style.visibility = "visible") {
  if (form.s_size.value == ""){
  alert("You must enter a size for your product.");
  form.s_size.focus();
  return (false);
  } 
 }
Code:
<div name="layer_s" id="layer_s" style="visibility: hidden;">
	  <table>
	 <tr><td class="arial10bold">Size:  </td><td><input type="text" name="s_size" value="" /></td></tr>
	</table>
	 </div>
When I submit my form, it keeps giving me an alert box. It works when the layer is visible, but when its hidden, it doesn't work. After the alert box pops up, the layer becomes visible because of the focus(). I'm trying to bypass that condition when the layer is hidden.

Clear as mud?

TIA