日期:2014-05-17  浏览次数:20957 次

下拉列框重大问题
代码如下,就是把下拉列框选中的值传递给文本框,但是如果下拉列框的值有空格,那么空格后面的字符串就传不了过去,why?高手指教…………
<input   name= "ftype "   type= "text "   id= "t "   size= "20 "   maxlength= "30 "   value= " ">
                                <select   name= 't1 '   onChange= "document.myform.ftype.value=options[selectedIndex].value; ">

------解决方案--------------------
<form id= "myform " name= "myform "> <input name= "ftype " type= "text " id= "t " size= "20 " maxlength= "30 " value= " ">
<select name= 't1 ' onChange= "document.myform.ftype.value=options[selectedIndex].value; ">
<option value= "1 22 "> 1 </option>
<option value= "00 "> 2 </option>
</select> </form>

//我试过,没问题呀
------解决方案--------------------
注意在循环设置select的option 的value时加“”: <option value= " <%=...%> ">