<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>印章饰花</title>
</head>
<script language="JavaScript"> 
<!-- 
<!-- 
function MM_reloadPage(init) {  //reloads the window if Nav4 resized 
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { 
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} 
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); 

MM_reloadPage(true); 
// --> 
 
function MM_findObj(n, d) { //v4.01 
  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); 
  if(!x && d.getElementById) x=d.getElementById(n); 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 selectvalue(str)
{
document.all.T1.value=str;
}
//--> 
</script>
<body>
<table>
<td width="89" align="center" height="35">印章饰花:</td>                                
      <td onMouseOver="MM_showHideLayers('HousingMenu','','show','ChargerMenu','','inherit')" onMouseOut="MM_showHideLayers('HousingMenu','','hide','ChargerMenu','','inherit')" width="38" height="35">                                
      <div class="menu2" style="width: 76; height: 13"><div align="center"><input type="text" name="T1" size="10" value="请选择">&nbsp;&nbsp;</div>                                 
      <div id="HousingMenu" style="height: 124; left: 191; overflow: auto; position: absolute; top: 15; width: 74; z-index: 5; visibility: hidden">                                  
        <table width="55" cellpadding="0" bgcolor="#E8967D" cellspacing="0">                                 
                                        
          <tr onclick="selectvalue('五角')">                                  
            <td class="menu2" height="20" width="20"></td>                                 
            <td class="menu2" height="20" width="35">五角</td>                                 
          </tr>                                
          <tr onclick="selectvalue('圆花')">                                  
            <td class="menu2" height="20" width="20"></td>                                 
            <td class="menu2" height="20" width="35">圆花</td>                                 
          </tr>                                
          <tr onclick="selectvalue('三角')">                                  
            <td class="menu2" height="20" width="20"></td>                                 
            <td class="menu2" height="20" width="35">三角</td>                                 
          </tr>                                
          <tr onclick="selectvalue('棱角')">                                  
            <td class="menu2" height="20" width="20"></td>                                 
            <td class="menu2" height="20" width="35">棱角</td>                                 
          </tr> 
          <tr onclick="selectvalue('棱角')">                                  
            <td class="menu2" height="20" width="20"></td>                                 
            <td class="menu2" height="20" width="35">棱角</td>                                 
          </tr> 
          <tr onclick="selectvalue('棱角')">                                  
            <td class="menu2" height="20" width="20"></td>                                 
            <td class="menu2" height="20" width="35">棱角</td>                                 
          </tr> 
          <tr onclick="selectvalue('棱角')">                                  
            <td class="menu2" height="20" width="20"></td>                                 
            <td class="menu2" height="20" width="35">棱角</td>                                 
          </tr> 
          <tr onclick="selectvalue('棱角')">                                  
            <td class="menu2" height="20" width="20"></td>                                 
            <td class="menu2" height="20" width="35">棱角</td>                                 
          </tr>                                   
       </table>                                 
      </div>                                 
      </div>  
</table>
<p> </p>
<p> </p>
<p>把鼠标放到请选择上,出现下拉框,我想点击下拉框中的选项后出现在文本框中,把请选择替换掉,请指教!</p>
</body>

解决方案 »

  1.   

    你那个层是不是div如果是的话,你可以把数据放到table中,然后让它响应onclick事件,让text框中的value=这个值就可以了
      

  2.   

    出现错误:file://C:\WINDOWS\TEMP\FrontPageTempDir\pvwC4.htm
    缺少对象,再请帮忙
      

  3.   

    试试下面这个。<html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>印章饰花</title>
    </head>
    <script language="JavaScript"> 
    var selectHtml = "<select name=\"seltn\" onchange=\"dosel();\">" ;
    selectHtml += "<option value=\"v1\">五角</option>" ;
    selectHtml += "<option value=\"v2\">圆花</option>" ;
    selectHtml += "<option value=\"v3\">三角</option>" ;
    selectHtml += "<option value=\"v4\">棱角</option>" ;
    selectHtml += "</select>" ;
    var textHtml = "<input type=\"text\" name=\"T1\" size=\"10\" onclick=\"disselect();\" value=\"请选择\">" ;
     function disselect(){
    document.all["divn"].innerHTML=selectHtml;
    for (i=0;i<document.all["seltn"].length;i++){
    if (document.all["seltn"].options[i].text==document.all["midd"].value){
    document.all["seltn"].options[i].selected =true;
    break;
    }
    }
     } function distext(){
    document.all["divn"].innerHTML=textHtml;
     }function dosel(){
    document.all["midd"].value=document.all["seltn"].options[document.all["seltn"].selectedIndex].text ;
    distext();
    document.all["T1"].value=document.all["midd"].value ;}
    </script>
    <body>
    <table>
    <td width="89" align="center" height="35">印章饰花:</td> 
    <input type="hidden" name="midd">
          <td onMouseOver="" onMouseOut="" width="38" height="35">                                
          <div class="menu2" style="width: 76; height: 13"><div id="divn" align="center"><input type="text" name="T1" size="10" onclick="disselect();" value="请选择">&nbsp;&nbsp;</div>                                 
          <div id="HousingMenu" style="height: 124; left: 191; overflow: auto; position: absolute; top: 15; width: 74; z-index: 5; visibility: hidden">                                  
            <table width="55" cellpadding="0" bgcolor="#E8967D" cellspacing="0">                                 
                                            
                                 
           </table>                                 
          </div>                                 
          </div>  
    </table>
    <p> </p>
    <p> </p>
    <p>把鼠标放到请选择上,出现下拉框,我想点击下拉框中的选项后出现在文本框中,把请选择替换掉,请指教!</p>
    </body> 
     
      

  4.   

    我这里运行很正常啊,跟我加的函数selectvalue没有关系,可能是你FrontPage系统问题,把文件头中有关FrontPage的2行去掉看行不行
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
      

  5.   

    Andrawu:我想xuheguan的意思是想改变select的样式吧,所以就不用select元素来实现
      

  6.   


    你现在用的不是真的下拉框,换用了下拉框后,点击下拉框后,document.文本框.value = document.下拉框.options[document.下拉框.selectedIndex].text 就行了。。