没有写一个弹出页面进行返回什么的。下面的这个效果也能表示出来。将取text框的值给select赋值,改为从子页面带回的值赋值即可!
变成这样window.opener.document.getElementById("Select1").selectedIndex =子页面带回的值
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<script type="text/javascript">
    function selectItem() {
        document.getElementById("Select1").selectedIndex = parseInt(document.getElementById("Text1").value);
    }
</script>
<body>
<select id="Select1">
    <option value="0">0</option>
    <option value="1">1</option>
</select>
    
<input id="Text1" type="text" />
<input id="Button1" type="button" value="button" onclick="selectItem()" /></body>
</html>

解决方案 »

  1.   

    disabled属性,设成true或者disabled都可以
      

  2.   

    看错题了~~
    <select id="Select1"  disabled="disabled" >
        <option value="0">0</option>
        <option value="1">1</option>
    </select>
      

  3.   

    直接在子页面操作父页面的select.
    var parentWin = window.opener;
    var obj = parentWin.document.getElementById("selectId");if(true){
      pt_dp.options[0].selected = true;
    }else{
      pt_dp.options[1].selected = true;
    }
    父页面的select
    <select id="selectId"  disabled="disabled" >
        <option value="0">0 </option>
        <option value="1">1 </option>
    </select>
      

  4.   

    打错字了,把上面代码中的pt_dp改成obj
      

  5.   

    谢谢大家 ,你们确定设置成disabled的时候,后台action能获取到select 里面的值吗?
    我原来用input就获取不到值。它好像不被提交的
      

  6.   

    那就用JS收集数据嘛.很多时候都需要先用js把数据收集好了存起来,比如放hidden里,然后在后台去取才行.
      

  7.   

    select控件上面叠加一个input,当change 后显示input的内容,而select隐藏,input的值来自于select的option
    input设置成readonly(不同于disable,readonly可以取到值)
      

  8.   

    <select name="s1" onFocus="this.blur()">
    <option value=""></option>
        <option value="1" selected>1</option>
    </select>
      

  9.   

    其实可以select用来显示,设置disabled属性。另外用个hidden用来传值,存入select的选中值即可