Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

JavaScript places Image Behind drop-down form

Posted on 2004-08-18
2
Medium Priority
?
251 Views
Last Modified: 2008-03-10
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
Comment
Question by:hankknight
  • 2
2 Comments
 
LVL 25

Accepted Solution

by:
James Rodgers earned 1600 total points
ID: 11834079
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
 
LVL 25

Expert Comment

by:James Rodgers
ID: 11844272
glad i could help

thanks for the points
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question