finnstone
asked on
stack (zindex?) a custom form element behind a select box
i have a custom for element that i want to stack behind a select box.
how can i do that? i am doing this because i want the mouseover to work on the custom form, thus i need the custom form text sizes and locations be exact match to the select box..can you help make sure they are the same size.
how can i do that? i am doing this because i want the mouseover to work on the custom form, thus i need the custom form text sizes and locations be exact match to the select box..can you help make sure they are the same size.
ASKER
here is my select box code can be seen at englishsomething.com/categ ory.cfm/ca tegoryoid= 5
<div id="Layer1" style="position:absolute; left:544px; top:206; width:124px; height:148px; z-index:1">
<cfif isDefined("url.categoryoid ")>
<!--- categoy list --->
<div style="position: absolute; left: 30px; top: 233px; width: 0px; height:0px; padding:0px;">
<form name="selectForm" action="#cgi.script_name#" method="get">
<table border="0" cellpadding="0" cellspacing="0" bgcolor="black" width="230">
<tr>
<td><table border="0" cellpadding="0" cellspacing="1" width="100%">
<tr bgcolor="#request.category .color#">
<td><font face="Arial,geneva,helveti ca,sans-se rif"><b>&n bsp; more
#request.category.displayn ame#</b></ font></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="1" width="230">
<tr bgcolor="#request.category .color#">
<td align="center" height="115">
<select name="productoid" size="6" class="label" onChange="submit()" style="font-family:arial,g eneva,helv etica,sans -serif;fon t-size:70% ;width:230 px;">
<cfloop query="request.category.pr oductList" >
<cfif mid(barcode1,1,1) neq "2">
<option value="#productoid#"style= "color:red ;" >#name#</option>
<cfelseif mid(barcode1,1,4) eq "2222">
<option value="#productoid#"style= "color:gre en;">#name #</option>
<cfelse>
<option value="#productoid#" >#name#</option>
</cfif>
</cfloop>
</select>
<input type="hidden" name="categoryoid" value="#url.categoryoid#">
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</div>
<br />
</cfif>
</div>
<div id="Layer1" style="position:absolute; left:544px; top:206; width:124px; height:148px; z-index:1">
<cfif isDefined("url.categoryoid
<!--- categoy list --->
<div style="position: absolute; left: 30px; top: 233px; width: 0px; height:0px; padding:0px;">
<form name="selectForm" action="#cgi.script_name#"
<table border="0" cellpadding="0" cellspacing="0" bgcolor="black" width="230">
<tr>
<td><table border="0" cellpadding="0" cellspacing="1" width="100%">
<tr bgcolor="#request.category
<td><font face="Arial,geneva,helveti
#request.category.displayn
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="1" width="230">
<tr bgcolor="#request.category
<td align="center" height="115">
<select name="productoid" size="6" class="label" onChange="submit()" style="font-family:arial,g
<cfloop query="request.category.pr
<cfif mid(barcode1,1,1) neq "2">
<option value="#productoid#"style=
<cfelseif mid(barcode1,1,4) eq "2222">
<option value="#productoid#"style=
<cfelse>
<option value="#productoid#" >#name#</option>
</cfif>
</cfloop>
</select>
<input type="hidden" name="categoryoid" value="#url.categoryoid#">
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</div>
<br />
</cfif>
</div>
If you put thw select on top of th ecustome element not of the effects are going to work becaus the mouse can only interact with the top element on the stack. As for the sizing use css to give the same dimenisions and some of the time the browser and setting s the user has set will make them the same size.
Cd&
Cd&
ASKER
then can i put the custom element on top of the seelct and just hide the text?
i am having trouble making the text line up, can you please show me :)
-rob
i am having trouble making the text line up, can you please show me :)
-rob
ASKER
line up and be the same size
ASKER
id also like to get rid of the links, how can i do that but keep the functionality?
thanks experts!
thanks experts!
ASKER
summarY:
i cant get spacing between the text the same as on the category page, see how it is bigger spacing on this page. i am still confused on what i need to specify on z valus and how i can get rid of links
i cant get spacing between the text the same as on the category page, see how it is bigger spacing on this page. i am still confused on what i need to specify on z valus and how i can get rid of links
ASKER
this page is englishtrunkshowco.com/tes t6.htm
ASKER
here is my latest and greatest test page..you can see the problem...the text in custom element does not match up to select box
You can't put the custom element on top of a select because it has a z-index of infinity. If there is so much of the select behaviour that you don't want; why use it at all? All you are doing is tying up the page in knots and creating accessibility issues.
Just use a custom control, and when yu are ready to submit, just populate hidden form fields to give the server side script what it needs to process. Having been down this road I can already tell you that every porblem you solve will create new problems and every hac and work around will just make the page less reliable and more difficult to maintain.
As for sizing and possitioning you are not ever going to get it exact cro-ss-browser, and when you throw in user prefrence settings you will be luck to render the way it is supposted to 60% of the time.
Cd&
Just use a custom control, and when yu are ready to submit, just populate hidden form fields to give the server side script what it needs to process. Having been down this road I can already tell you that every porblem you solve will create new problems and every hac and work around will just make the page less reliable and more difficult to maintain.
As for sizing and possitioning you are not ever going to get it exact cro-ss-browser, and when you throw in user prefrence settings you will be luck to render the way it is supposted to 60% of the time.
Cd&
ASKER
ok.
well how can i make this custom box look good and get rid of the bullets. i want it to be scrollable. look at this page, you can actually see that the custom element works behind the select , however the custom element does not look very nice . i would get rid of select if i can make the custom look like it.
well how can i make this custom box look good and get rid of the bullets. i want it to be scrollable. look at this page, you can actually see that the custom element works behind the select , however the custom element does not look very nice . i would get rid of select if i can make the custom look like it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can try something like this if you just need to have the look and feel of a select:
<html>
<head>
<style>
.selectBOX {border:3px ridge #dddddd;height:75;width:16 0;overflow :auto;
border-right:3px double #bbbbbb; border-bottom:3px double #bbbbbb;}
.hiliteON {color:white;background-co lor:navy;f ont-family :arial;fon t-size:10p t;}
.hiliteOFF {color:black;background-co lor:white; font-famil y:arial;fo nt-size:10 pt}
</style>
<script type="text/javascript">
<!--
var lastone=false;
function chgcls(EL)
{
if (lastone)
{
lastone.className="hiliteO FF";
}
lastone=EL;
lastone.className="hiliteO N"
}
//-->
</script>
</head>
<body>
<h1> Fake Form Elements </h1>
<div class="selectBOX">
<table border="0" cellspacing="0" cellpadding="0">
<tr><td class="hiliteOFF" onClick="chgcls(this)">Alb erta</td>< /tr>
<tr><td class="hiliteOFF" onClick="chgcls(this)">Ont ario</td>< /tr>
<tr><td class="hiliteOFF" onClick="chgcls(this)">Yuk on in the far north</td></tr>
<tr><td class="hiliteOFF" onClick="chgcls(this)">Que bec</td></ tr>
<tr><td class="hiliteOFF" onClick="chgcls(this)">New foundland< /td></tr>
<tr><td class="hiliteOFF" onClick="chgcls(this)">all fake 1</td></tr>
<tr><td class="hiliteOFF" onClick="chgcls(this)">all fake 2</td></tr>
<tr><td class="hiliteOFF" onClick="chgcls(this)">all fake 3</td></tr>
<tr><td class="hiliteOFF" onClick="chgcls(this)">all fake 4</td></tr>
<tr><td class="hiliteOFF" onClick="chgcls(this)">all fake 5</td></tr>
</table>
</div>
</body>
</html>
Even though the fake select is not a functional form element, we
could still capture the cell value with the onClick event and use
it for processing. The best way we put the link as the title
attribute of the cell an then it can be refrence through the node
object of the cell, and fire with Javascript.
The mouseove would the same as it is now except it would be on the cell.
Let me know itf yu want to try it like that and I wil set up more complete
code. This is just some old code i had on my HD that I tweak a little.
Cd&
<html>
<head>
<style>
.selectBOX {border:3px ridge #dddddd;height:75;width:16
border-right:3px double #bbbbbb; border-bottom:3px double #bbbbbb;}
.hiliteON {color:white;background-co
.hiliteOFF {color:black;background-co
</style>
<script type="text/javascript">
<!--
var lastone=false;
function chgcls(EL)
{
if (lastone)
{
lastone.className="hiliteO
}
lastone=EL;
lastone.className="hiliteO
}
//-->
</script>
</head>
<body>
<h1> Fake Form Elements </h1>
<div class="selectBOX">
<table border="0" cellspacing="0" cellpadding="0">
<tr><td class="hiliteOFF" onClick="chgcls(this)">Alb
<tr><td class="hiliteOFF" onClick="chgcls(this)">Ont
<tr><td class="hiliteOFF" onClick="chgcls(this)">Yuk
<tr><td class="hiliteOFF" onClick="chgcls(this)">Que
<tr><td class="hiliteOFF" onClick="chgcls(this)">New
<tr><td class="hiliteOFF" onClick="chgcls(this)">all
<tr><td class="hiliteOFF" onClick="chgcls(this)">all
<tr><td class="hiliteOFF" onClick="chgcls(this)">all
<tr><td class="hiliteOFF" onClick="chgcls(this)">all
<tr><td class="hiliteOFF" onClick="chgcls(this)">all
</table>
</div>
</body>
</html>
Even though the fake select is not a functional form element, we
could still capture the cell value with the onClick event and use
it for processing. The best way we put the link as the title
attribute of the cell an then it can be refrence through the node
object of the cell, and fire with Javascript.
The mouseove would the same as it is now except it would be on the cell.
Let me know itf yu want to try it like that and I wil set up more complete
code. This is just some old code i had on my HD that I tweak a little.
Cd&
ASKER
your second code has no mouseover effect?
thanks cd& looks like alot of work on your part!! THANKS FOR DIGGING FOR YOUR OLD CODE
thanks cd& looks like alot of work on your part!! THANKS FOR DIGGING FOR YOUR OLD CODE
ASKER
WOW, cool , the first code works just like i want...i will now try and change to exactly what i want because i need an onclick event as you can see at
http://englishtrunkshowco.com/category.cfm/categoryoid=1
but i think it wont be too hard because my selevt form doesnt have an onclick right now but a onchange event currently as you can see
<form name="selectForm" action="#cgi.script_name#" method="get">
<select name="productoid" size="6" class="label" onChange="submit()" style="font-family:arial,g eneva,helv etica,sans -serif;fon t-size:70% ;width:230 px;">
http://englishtrunkshowco.com/category.cfm/categoryoid=1
but i think it wont be too hard because my selevt form doesnt have an onclick right now but a onchange event currently as you can see
<form name="selectForm" action="#cgi.script_name#"
<select name="productoid" size="6" class="label" onChange="submit()" style="font-family:arial,g
ASKER
could you go into more detail on how i can execute the onchange to start working?
one other 1, will this be compatible with other broswers besides IE?
one other 1, will this be compatible with other broswers besides IE?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
im using coboals code, but i will loook at yours for the submit form hint..
i have a q, im getting an error on my site now as i try and port the code over
here it is
Invalid token '{' found on line 409 at column 10.
<p>The CFML compiler was processing:<ul><li>The body of a cfoutput tag beginning on line 24, column 18.<li>The body of a cfoutput tag beginning on line 24, column 18.<li>The body of a cfoutput tag beginning on line 24, column 18.</ul>
The error occurred in D:\Inetpub\englishtrunksho wco\extens ions\custo mtags\wrap per.cfm: line 409
407 :
408 : /* Loads First Image At Page Load, and Positions Flipped Images */
409 : #theimage{position:relativ e;
410 : top:25px;
411 : left:300px;}
i have a q, im getting an error on my site now as i try and port the code over
here it is
Invalid token '{' found on line 409 at column 10.
<p>The CFML compiler was processing:<ul><li>The body of a cfoutput tag beginning on line 24, column 18.<li>The body of a cfoutput tag beginning on line 24, column 18.<li>The body of a cfoutput tag beginning on line 24, column 18.</ul>
The error occurred in D:\Inetpub\englishtrunksho
407 :
408 : /* Loads First Image At Page Load, and Positions Flipped Images */
409 : #theimage{position:relativ
410 : top:25px;
411 : left:300px;}
ASKER
ignore that error fixed it .. genreated beause im using a cfm page
ASKER
i am getting this erro r though if you can help L::)))
Invalid CFML construct found on line 448 at column 173.
ColdFusion was looking at the following text:<p>\"</p><p>The CFML compiler was processing:<ul><li>An expression that began on line 448, column 166.<br>Your expression might be missing an ending "#" (it might look like #expr ).<li>The body of a cfoutput tag beginning on line 24, column 18.<li>The body of a cfoutput tag beginning on line 24, column 18.<li>The body of a cfoutput tag beginning on line 24, column 18.<li>The body of a cfoutput tag beginning on line 24, column 18.</ul>
The error occurred in D:\Inetpub\englishtrunksho wco\extens ions\custo mtags\wrap per.cfm: line 448
446 : <cfif isDefined("url.categoryoid ")>
447 : <!--- categoy list --->
448 : <div id="menu" style="position: absolute; left: 30px; top: 233px; width: 0px; height:0px; padding:0px; overflow:hidden;overflow-y :auto;bord er:1px solid #000000">
449 : <form name="selectForm" action="#cgi.script_name#" method="get">
450 : <table border="0" cellpadding="0" cellspacing="0" bgcolor="black" width="230">
Invalid CFML construct found on line 448 at column 173.
ColdFusion was looking at the following text:<p>\"</p><p>The CFML compiler was processing:<ul><li>An expression that began on line 448, column 166.<br>Your expression might be missing an ending "#" (it might look like #expr ).<li>The body of a cfoutput tag beginning on line 24, column 18.<li>The body of a cfoutput tag beginning on line 24, column 18.<li>The body of a cfoutput tag beginning on line 24, column 18.<li>The body of a cfoutput tag beginning on line 24, column 18.</ul>
The error occurred in D:\Inetpub\englishtrunksho
446 : <cfif isDefined("url.categoryoid
447 : <!--- categoy list --->
448 : <div id="menu" style="position: absolute; left: 30px; top: 233px; width: 0px; height:0px; padding:0px; overflow:hidden;overflow-y
449 : <form name="selectForm" action="#cgi.script_name#"
450 : <table border="0" cellpadding="0" cellspacing="0" bgcolor="black" width="230">
ASKER
ignore..i found a missing # again..
ASKER
next problem the custom select is not showing up////see at englishtrunkshowco.com/cat egory.cfm/ categoryoi d=1
heres my new code
<div id="Layerold" style="position:absolute; left:544px; top:206; width:124px; height:148px; z-index:1">
<cfif isDefined("url.categoryoid ")>
<!--- categoy list --->
<div id="menu" style="position: absolute; left: 30px; top: 233px; width: 0px; height:0px; padding:0px; overflow:hidden;overflow-y :auto;bord er:1px solid 000000">
<form name="selectForm" action="#cgi.script_name#" method="get">
<table border="0" cellpadding="0" cellspacing="0" bgcolor="black" width="230">
<tr>
<td><table border="0" cellpadding="0" cellspacing="1" width="100%">
<tr bgcolor="#request.category .color#">
<td><font face="Arial,geneva,helveti ca,sans-se rif"><b>&n bsp; more
#request.category.displayn ame#</b></ font></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="1" width="230">
<tr bgcolor="#request.category .color#">
<td align="center" height="115">
<ul class="items">
<cfloop query="request.category.pr oductList" >
<cfif mid(barcode1,1,1) neq "2">
<li style="color:red;font-fami ly:arial,g eneva,helv etica,sans -serif;fon t-size:70% ;width:230 px;"><a href="linkone.html"
class="menu" onMouseOver="document.getE lementById ('Image'). src='image s/#image#' ;"
onMouseOut="document.getEl ementById( 'Image').s rc='blank. gif';" >#name#</a></li>
<cfelseif mid(barcode1,1,4) eq "2222">
<li style="color:green;font-fa mily:arial ,geneva,he lvetica,sa ns-serif;f ont-size:7 0%;width:2 30px;"><a href="linkone.html"
class="menu" onMouseOver="document.getE lementById ('Image'). src='image s/#image#' ;"
onMouseOut="document.getEl ementById( 'Image').s rc='blank. gif';" >#name#</a></li>
<cfelse>
<li style="font-family:arial,g eneva,helv etica,sans -serif;fon t-size:70% ;width:230 px;"><a href="linkone.html"
class="menu" onMouseOver="document.getE lementById ('Image'). src='image s/#image#' ;"
onMouseOut="document.getEl ementById( 'Image').s rc='blank. gif';" >#name#</a></li>
</cfif>
</cfloop></ul>
</select>
<input type="hidden" name="categoryoid" value="#url.categoryoid#">
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</div>
<br />
</cfif>
</div>
heres my new code
<div id="Layerold" style="position:absolute; left:544px; top:206; width:124px; height:148px; z-index:1">
<cfif isDefined("url.categoryoid
<!--- categoy list --->
<div id="menu" style="position: absolute; left: 30px; top: 233px; width: 0px; height:0px; padding:0px; overflow:hidden;overflow-y
<form name="selectForm" action="#cgi.script_name#"
<table border="0" cellpadding="0" cellspacing="0" bgcolor="black" width="230">
<tr>
<td><table border="0" cellpadding="0" cellspacing="1" width="100%">
<tr bgcolor="#request.category
<td><font face="Arial,geneva,helveti
#request.category.displayn
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="1" width="230">
<tr bgcolor="#request.category
<td align="center" height="115">
<ul class="items">
<cfloop query="request.category.pr
<cfif mid(barcode1,1,1) neq "2">
<li style="color:red;font-fami
class="menu" onMouseOver="document.getE
onMouseOut="document.getEl
<cfelseif mid(barcode1,1,4) eq "2222">
<li style="color:green;font-fa
class="menu" onMouseOver="document.getE
onMouseOut="document.getEl
<cfelse>
<li style="font-family:arial,g
class="menu" onMouseOver="document.getE
onMouseOut="document.getEl
</cfif>
</cfloop></ul>
</select>
<input type="hidden" name="categoryoid" value="#url.categoryoid#">
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</div>
<br />
</cfif>
</div>
I have used in both Mozilla an IE, son't know a bout additional browsers because I have never had to support Opera or Safari.
as for implementing an on change; that gets run off the the onclick of the option:
<tr><td class="hiliteOFF" title="linkone.htm"
onClick="chgcls(this); dosubmit(this.title,this.c hildeNode[ 0].innerHT ML);"><spa n
style="display:none">29.95 </span>all fake 2</td></tr>
Te apsn with the option value stays hidden, but the value gets passed to the submit return along with the link that is stored in the title attribute.
Cd&
as for implementing an on change; that gets run off the the onclick of the option:
<tr><td class="hiliteOFF" title="linkone.htm"
onClick="chgcls(this); dosubmit(this.title,this.c
style="display:none">29.95
Te apsn with the option value stays hidden, but the value gets passed to the submit return along with the link that is stored in the title attribute.
Cd&
ASKER
i used the code in a test and it worked at test10.cfm but then i put it in my main site and thecustom box is not showing up??
Well I don't know Cold Fusion, but is sound like the styles are missing on invalid. A bad style entry can mess up hte whole stylesheet.
Cd&
Cd&
ASKER
what do you mean by on invalid?
the styles worked in test10.cfm thats what is a litle weird
the styles worked in test10.cfm thats what is a litle weird
An incorrect entry; especially a syntax error. When you were looking at it in test, was it coming froma server os some kind of preview mode in CF?
Cd&
Cd&
ASKER
last questions...home stretch. thanks guys..( BTW IT IS NOW FULLY FUNCTIONAL AND IM JUST CHANING HOW THE TEXT WORKS...THANKS!!)
1) how can i set the text not to look like a link and make the text black
2) how can i set the background to white
for instance i want it to look like it used to
here is how it used to look (check it out)
englishtrunkshowco.com/old category.c fm/categor yoid=12
1) how can i set the text not to look like a link and make the text black
2) how can i set the background to white
for instance i want it to look like it used to
here is how it used to look (check it out)
englishtrunkshowco.com/old
ASKER
sorry one more
3) need a black line at the bottom of the new custom select box - notice you have to scroll to get to it instead of it persisting as a bottom while text values scroll
3) need a black line at the bottom of the new custom select box - notice you have to scroll to get to it instead of it persisting as a bottom while text values scroll
How come I got all the points in this question? A mistake I guess finnstone.
Batalf
Batalf
ASKER
yes i thought i split the points 400 to 100 in his favor, ill do a mod
Did I just receive all the points again?
:-)
:-)
ASKER
yes..sorry i didnt end up using any of his code and had thought it was his when it was yours that was helpful
OK, Thanks, but I think Cd& deserves alot of points for assisting you as well.
Batalf
Batalf
No its fine the way it is. After all the teapots I am going to go have a cupa tea...
Cd&
Cd&
#A lot of laughing#
ASKER
ENJOY the tea") thanks for the help. i opened a new question that i could really use help with in the css category, my new select box does not seem to have a bottom part like the old one did.
ASKER
<div id="Layer1" style="position:absolute; left:541px; top:137px; width:55px; height:64px; z-index:1"><img id="Image" src="blank.gif"></div>
<style type="text/css">
body{
margin-left:0;
margin-right:0;
margin-top:0;
margin-bottom:0;
padding-left:0;
padding-right:0;
padding-top:0;
padding-bottom:0;
background:white;}
/* Displays Menu Links */
#menu{position:relative;
left:25px;
top:100px;
width:200px;
background:white;}
/* Loads First Image At Page Load, and Positions Flipped Images */
#theimage{position:relativ
top:25px;
left:300px;}
.menu{font-family: times new roman;
font-size: 12pt;}
.menu a:link {color: blue;
text-decoration: none;}
.menu a:visited {color: blue;
text-decoration: none;}
.menu a:hover {color: green;
text-decoration: underline;
background-color: ;}
.menu a:active {color: orange;
text-decoration: none;}
</style>
<div id="menu">
<ul>
<li><a href="linkone.html"
class="menu" onMouseOver="document.getE
onMouseOut="document.getEl
<li><a href="linktwo.html"
class="menu" onMouseOver="document.getE
onMouseOut="document.getEl
</ul>
</div>