请教一个问题 假设我数据库里有三个字段ys(颜色),zdz(最低值),zgz(最高值);ys字段里有四个值01,02,03,04.现在我想让每一个颜色值对应一个最低值和最高值即01对应[10,20],02对应[20,30]以此类对,请问这个js怎么写,来控制text框里的值需在对应的区间内?------------颜色字段是个下拉框,,,,,,, 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <script type="text/javascript">function ss(){ var se=document.getElementById("test"); var a=se[se.selectedIndex].value; document.getElementById("test2").value=a;}</script></head><body><select id="test" onchange="ss()"> <option value="[10-20]">01</option> <option value="[20-30]">02</option> <option value="[30-40]">03</option> <option value="[40-50]">04</option></select><input type="text" id="test2"></body>完全不明白你的意思 <table id=tableId border="0" cellspacing="1" cellpadding="0" align="center" width="95%"> <tr> <td> <fieldset style="width: 98%"> <table width="100%" class="grid2"> <tr height="25"> <td class="title" width="130">颜色类型 <font color="#ff0000">*</font> </td> <td class="content" width="280"> <select name="yslxbh" id="yslxbh" style="width: 240px;" > <%=ysLogic.getYslxbhOption(yslxbh) %> </select> </td> </tr> </table> <table width="100%" class="grid2"> <tr height="25"> <td class="title" width="130">最低值 <font color="#ff0000">*</font> </td> <td class="content" width="280"> <input type="text" name="zdfz" id="zdfz" value="<%=zdz %>" style="width: 240px;" onblur="checkNumber()" /> </td> </tr> </table> <table width="100%" class="grid2"> <tr height="25"> <td class="title" width="130">最高值 <font color="#ff0000">*</font> </td> <td class="content" width="280"> <input type="text" name="zgfz" id="zgfz" value="<%=zgz %>" style="width: 240px;" onblur="checkNumber()" /> </td> </tr> </table> </fieldset></td> </tr> </table> <script type="text/javascript">function ss(){ var se=document.getElementById("test"); var a=se[se.selectedIndex].value; a=a.split('-') document.getElementById("test2").value=a[0]; document.getElementById("test3").value=a[1];}</script></head><body><select id="test" onchange="ss()"> <option value="10-20">01</option> <option value="20-30">02</option> <option value="30-40">03</option> <option value="40-50">04</option></select><br/>最低<input type="text" id="test2"><br/>最高<input type="text" id="test3">这样?? 我这个jquery写的怎么点了button没反应啊 08年发的题为“高分求救对动态表格的计算问题”的贴子所示代码存在缺陷 求一正则表达式 请教个如何可以知道天涯论坛的分页的地址 javascript 浏览器判断 有一句不理解 高分急求高手解决.net问题 请问框架里面的页面如何获取父窗口的高度? 请教正则高手 高分相求,万分感谢. 一个字符串的简单问题 ext 报events 为空 或不是对象,是什么情况?? javascript调用ruby方法
function ss(){
var se=document.getElementById("test");
var a=se[se.selectedIndex].value;
document.getElementById("test2").value=a;
}
</script>
</head><body>
<select id="test" onchange="ss()">
<option value="[10-20]">01</option>
<option value="[20-30]">02</option>
<option value="[30-40]">03</option>
<option value="[40-50]">04</option>
</select>
<input type="text" id="test2">
</body>
完全不明白你的意思
align="center" width="95%">
<tr>
<td>
<fieldset style="width: 98%">
<table width="100%" class="grid2">
<tr height="25">
<td class="title" width="130">颜色类型 <font
color="#ff0000">*</font> </td>
<td class="content" width="280">
<select name="yslxbh" id="yslxbh" style="width: 240px;" >
<%=ysLogic.getYslxbhOption(yslxbh) %>
</select>
</td>
</tr>
</table>
<table width="100%" class="grid2">
<tr height="25">
<td class="title" width="130">最低值 <font
color="#ff0000">*</font> </td>
<td class="content" width="280">
<input type="text" name="zdfz" id="zdfz" value="<%=zdz %>" style="width: 240px;" onblur="checkNumber()" />
</td>
</tr>
</table>
<table width="100%" class="grid2">
<tr height="25">
<td class="title" width="130">最高值 <font
color="#ff0000">*</font> </td>
<td class="content" width="280">
<input type="text" name="zgfz" id="zgfz" value="<%=zgz %>" style="width: 240px;" onblur="checkNumber()" />
</td>
</tr>
</table>
</fieldset></td>
</tr>
</table>
function ss(){
var se=document.getElementById("test");
var a=se[se.selectedIndex].value;
a=a.split('-')
document.getElementById("test2").value=a[0];
document.getElementById("test3").value=a[1];
}
</script>
</head><body>
<select id="test" onchange="ss()">
<option value="10-20">01</option>
<option value="20-30">02</option>
<option value="30-40">03</option>
<option value="40-50">04</option>
</select><br/>
最低<input type="text" id="test2"><br/>
最高<input type="text" id="test3">
这样??