想要在AJAX参数中传递4个值。前三个正常传递,但第四个给出了问题。我在AJAX中显示警告后知道了
<tr align="left">
<td style="background-color:#1569C7;color:white;font-weight:bold;font-size:110%;border-style:outset;"><center><b>Test Conducted</b></center></td>
<td><select onchange="javascript:type123(document.getElementById('fodate').value,document.getElementById('todate').value,document.getElementById('product').value);" id="testcond" name="testcond">
<option>--Select--</option>
</select></td>
</tr>
AJAX代码:
<script language="javascript">
var xmlHttp1=null;
function type123(obj,obj1,obj2)
{
//alert(this.value);
var type_value=document.getElementById('testcond').options.selectedIndex.value;
var val1=obj;
var val2=obj1;
var val3=obj2;
// var val4=obj3;
alert(val1);
alert(val2);
alert(val3);
alert(type_value);
答案 0 :(得分:0)
而不是
var type_value=document.getElementById('testcond').options.selectedIndex.value;
您可以尝试使用此选项获取Combo-Box的选定值
var type_value=document.getElementById('testcond').value;<br/>alert(type_value);