Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

JavaScript places Image Behind drop-down form

Posted on 2004-08-18
2
212 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 400 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
I want a tab to always be underlined when I open div then change 1 33
Alert after MVC form submitted 1 22
jquery tab header text 1 22
JQuery Syntax... 4 29
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

808 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