<script language="JavaScript">
<!--
    function show(Sign , oRadio){
        if(Sign == 'r1'){
            document.getElementById("otext").style.display = oRadio.checked ? "block" : "none";
            document.getElementById("osel").style.display = !oRadio.checked ? "block" : "none";        }else{
            document.getElementById("otext").style.display = !oRadio.checked ? "block" : "none";
            document.getElementById("osel").style.display = oRadio.checked ? "block" : "none";
        }
    }
//-->
</script>
<input type="radio" name="val" onclick="show('r1',this)">R1
<input type="radio" name="val" onclick="show('r2',this)">R2
<input type="text" name="otext" id="otext" style="display:none">
<select id="osel" style="display:none">
<option>1</option>
<option>2</option>
<option>3</option>
</select>上面代码是实现2个单选,分别选中其中一个就显示相对应的。但实际中是点R1 显示1个下拉框A, 点R2显示3个下拉框BCD  分别代表年月日我照这个例子依葫芦画瓢,但出现个问题就是点R2后显示的3个下拉框应该是 B年C月D日就是那3个 年月日的显示问题,直接敲上去,会直接显示我用label 显示的时候又会错位变丑
谁能给我支个招?

解决方案 »

  1.   

    <select id="osel" style="display:none"> 
    <option>1 </option> 
    <option>2 </option> 
    <option>3 </option> 
    </select> --------------------------没有value.
    -<select id="osel" style="display:none"> 
    <option value=1>1 </option> 
    <option value=2>2 </option> 
    <option value=3>3 </option> 
    </select> 
    页面偶不用做,特效偶也不用写,都有专业人士去弄,偶不懂得~~