送分:从文本框和选择框的数值判断结果!!

取文本框n1(用户输入)数值,选择框s1(3选项),s2(2选项)的value 判断结果输出在另一个文本框n2
if n1.value<380 and s1=1 and s2 =1 then n2=aa1
else
if n1.value<380 and s1=2 and s2 =1 then n2=aa2
.....
具体代码怎么写?(最好可以扩展)

---------------------------------------------------------------

http://expert.csdn.net/Expert/TopicView1.asp?id=942792
下载参考手册

参考
http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_entry.asp
---------------------------------------------------------------

1<script>   
2function go(s,v){   
3if(s.selectedIndex==0)return;   
4if(parseInt(n1.value)<380&&s2.value=='1')n2.value="aa"+s1.value   
5else return   
6}   
7</script>
1<input id="n1"/>
1<select id="s1" onchange="go(s1,value)">
2<option>请选择   
3<option value="1">1   
4<option value="2">2   
5<option value="3">3   
6</option></option></option></option></select>
1<select id="s2" onchange="go(s2,value)">
2<option>请选择   
3<option value="1">1   
4<option value="2">2   
5<option value="3">3   
6</option></option></option></option></select>
1<input id="n2"/>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus