请问select下拉框如何显示为一条下划线
我的程序如下:
<style>
.arrow {
font-family: Webdings;
font: 9pt;
color: blue;
text-align: center;
cursor: hand;
background: white;
}
.seltxt{
border-left:0;
border-right:0;
border-top:0;
border-bottom:1 solid #000000;
}
</style>
<script language="JavaScript">
str="";
mywidth=0;
function showdiv(w)
{
document.all.mysel.style.display="none";
str="<input type=text class=seltxt style='width:"+w+";' readOnly onclick=showlist() value="+document.all.mysel.options[document.all.mysel.selectedIndex].text+">";
liststr="<table style='border:1 solid #000000;' width="+w+" cellspacing=0 cellpadding=0>";
for(i=0;i<document.all.mysel.options.length;i++)
liststr+="<tr><td style='font-size:10pt' onmouseover=myover() onmouseout=myout() onclick=myclick("+i+")>"+document.all.mysel.options[i].text+" </td></tr>";
liststr+="</table>";
likesel.innerHTML=str;
mywidth=w;
}
function showlist()
{
if(likesel.innerHTML.indexOf("TABLE")==-1)
likesel.innerHTML+=liststr;
}
function myover()
{
event.srcElement.style.cursor="default";
event.srcElement.style.color="white";
event.srcElement.style.background="darkblue";
}
function myout()
{
event.srcElement.style.color="";
event.srcElement.style.background="";
}
function myclick(j)
{
document.all.mysel.selectedIndex=j;
str="<input type=text class=seltxt style='width:"+mywidth+";' readOnly onclick=showlist() value="+document.all.mysel.options[document.all.mysel.selectedIndex].text+">";
likesel.innerHTML=str;
document.all.arrow.disabled=false;
}
</script>
<body onload="showdiv(mysel.offsetWidth)">
<table cellpadding="2" cellspacing="1" border="0" class="border" align=center>
<form name="add_Menuform" method="post" action="?action=addsaveinfo&Sub_Author=<%=strSub_Author%>">
<tr class="title">
<td width="20%">生产厂家</td>
<td width="20%">钢材名称</td>
<td width="20%">钢材材质</td>
<td width="20%">基价</td>
<td>操 作</td>
</tr>
<tr class="titletdbg">
<td align="center"><select name=mysel>
<option value=11 selected>1111111
<option value=12>111112
<option value=13>1111111113
</select>
<table border=0><tr><td><span id=likesel></span></td><td valign=top><span id=arrow class=arrow onclick=showlist()>6</span></td></tr></table>
</td>
<td align="center"><input type="text" name="SteelName" class="doc_txt" size="18" value=""></td>
<td align="center"><input type="text" name="SteelMaterial" class="doc_txt" size="18" value=""></td>
<td align="center"><input type="text" autocomplete=off name="BasePrice" class="doc_txt" size="18" onKeyPress="event.returnValue=IsDigit();" style="ime-mode:disabled"></td>
<td width="13%" align="center"><input type="submit" class="button" name="Submit" value=" 添 加 "></td>
</tr>
</form>
</table>
其中<select name=mysel>
<option value=11 selected>1111111
<option value=12>111112
<option value=13>1111111113
</select>
如果这句话跟在<body>之后显示是没有问题,但是放在<table>里就显示错误:'mysel'没有定义,不知道为什么,请问高手们有什么办法解决,或是有其他的方法完成这种显示效果。