• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 259
  • Last Modified:

JavaScript places Image Behind drop-down form

Hello.  

The code below is causing the color selection image to appear behind the drop-down box, so that it says "Percent" on top of the colors.

---------------------------------------------
<br /><br /><br /><br />
<script>
function getInfoAndUpdate()
{
   if (isNaN(formNumRows.value))
   {
      alert ("The rows field can only contain numbers");return;
   }
   else if (isNaN(formNumCols.value))
   {
      alert ("The colums field can only contain numbers");return;
   }
   var callerWindowObj = dialogArguments;
   callerWindowObj.rtNumRows = formNumRows.value;
   callerWindowObj.rtNumCols = formNumCols.value;
   callerWindowObj.rtTblCellspacing = formCellspacing.value;
   callerWindowObj.rtTblCellspadding = formCellspadding.value;
   callerWindowObj.rtTblAlign = formTblAlign.value;
   callerWindowObj.rtTblWidth = formTblWidth.value + formTblWidthtype.value;
   callerWindowObj.rtTblBorder = formTblBorder.value;
   callerWindowObj.rtTblBgColor = Bgcolor.value;
   callerWindowObj.rtTblBrColor = Brcolor.value;
   callerWindowObj.createTable();
   window.close();
}
</script>
<script language=JavaScript>
<!--

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function show(val2) {
Bgcolor.value = ' bgcolor="'+val2+'"';
B3.style.backgroundColor = val2;
}
function showM(val3) {
Brcolor.value = ' bordercolor="'+val3+'"';
B2.style.backgroundColor = val3;
}
//-->
</script>

<script language=javascript>
<!--

var isNS = (navigator.appName == "Netscape") ? 1 : 0;
var EnableRightClick = 0;
if(isNS)
document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP);
function mischandler(){
  if(EnableRightClick==1){ return true; }
  else {return false; }
}
function mousehandler(e){
  if(EnableRightClick==1){ return true; }
  var myevent = (isNS) ? e : event;
  var eventbutton = (isNS) ? myevent.which : myevent.button;
  if((eventbutton==2)||(eventbutton==3)) return false;
}
function keyhandler(e) {
  var myevent = (isNS) ? e : window.event;
  if (myevent.keyCode==96)
    EnableRightClick = 1;
  return;
}
document.oncontextmenu = mischandler;
document.onkeypress = keyhandler;
document.onmousedown = mousehandler;
document.onmouseup = mousehandler;
//-->
</script>


<table align="center" border="0" cellpadding="0" cellspacing="0" width="400">
      <tr>
            <td>Table Width:</td>
            <td colspan="3">
                  <input id=formTblWidth size="3" value="100">
                  <select id=formTblWidthtype size="1">
                        <option value="%">Percent</option>
                        <option value="">Pixels</option>
                  </select>
            </td>
      </tr>
      <tr>
            <td>Cell Colour:</td>
            <td><input name="B3" id="B3" onmouseout="MM_showHideLayers('Bgc','','hide');" onmouseover="MM_showHideLayers('Bgc','','show');" style="BACKGROUND-COLOR: #cccccc; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; CURSOR: hand; WIDTH: 25px" type='button' value=" "></td>
            <td>Border Colour: </td>
            <td><input name="B2" id="B2" onmouseout="MM_showHideLayers('Brc','','hide');" onmouseover="MM_showHideLayers('Brc','','show');" style="BACKGROUND-COLOR: #cccccc; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; CURSOR: hand; WIDTH: 25px" type='button' value=" ">
                  <input name="Bgcolor" id="Bgcolor" type="hidden">
                  <input name="Brcolor" id="Brcolor" type="hidden">
            </td>
      </tr>
</table>
<br>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr>
            <td width="50%" align="right"><input value="OK" type=button onclick='getInfoAndUpdate();'>&nbsp;</td>
            <td width="50%" align="left">&nbsp;<input value="Cancel" type=button onclick='window.close();'></td>
      </tr>
</table>
<DIV id=Brc onmouseout="MM_showHideLayers('Brc','','hide');"
onmouseover="MM_showHideLayers('Brc','','show');"
style="HEIGHT: 67px; LEFT: 120px; POSITION: absolute; TOP: 100px; VISIBILITY: hidden; WIDTH: 289px; Z-INDEX: 1"><A><IMG
border=0 height=67 src="images/colortable.gif"
useMap=#colmapMap2Map width=289></A><MAP name=colmapMap2Map>
<AREA coords=1,1,7,10 onClick="javascript:showM('#00FF00');" shape=RECT></MAP></DIV>
<DIV id=Bgc onmouseout="MM_showHideLayers('Bgc','','hide');"
onmouseover="MM_showHideLayers('Bgc','','show');"
style="HEIGHT: 67px; LEFT: 75px; POSITION: absolute; TOP: 100px; VISIBILITY: hidden; WIDTH: 289px; Z-INDEX: 1"><A><IMG
border=0 height=67 src="images/colortable.gif"
useMap=#colmapMap2MapMap width=289></A><MAP name=colmapMap2MapMap>
<AREA coords=1,1,7,10 onClick="javascript:show('#00FF00');" shape=RECT></MAP></DIV>
</body>
</html>
0
hankknight
Asked:
hankknight
  • 2
1 Solution
 
James RodgersWeb Applications DeveloperCommented:
dropdown list have infinite z-index and cannot be overlapped, you will need to redesign the page or use code to change teh visibility of teh dropdown under some circumstances

see here for more

How to have a div float over a select (normally can't be done, nice fix, code by devic)
   http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_20834025.html
0
 
James RodgersWeb Applications DeveloperCommented:
glad i could help

thanks for the points
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now