我必须根据选择打印选定的drowndown名称和文本框名称。
我有一组下拉列表和两个文本框。在从测试/平台和日期等下拉列表中选择值时,我必须从test,bplatform和date打印值。
<div id="inputForm" style="background:#F2F9FA">
<div style="display:inline-block;width:auto;float:right;">
<b>Date & Time (From - To):</b><br/><input id="datetimepickerfrom" name="date" type="text" style="width:125px;" >
- <input name="date" id="datetimepickerto" type="text" style="width:125px;" >
</div>
<div style="display:inline-block;width:auto;">
<b>Filters:</b><br/>
<select class="longcombo filterCombo" name ="test" id="testnames"></select>
<select class="longcombo filterCombo" name ="user name" id="usernames" style="width:150px;"></select>
<select class="longcombo filterCombo" name ="platform" id="platforms"></select>
<select class="longcombo filterCombo" name ="result" id="res" style="width:105px;"></select>
</div>
<br><br>
</div>
答案 0 :(得分:0)
如果我理解你的问题是正确的,你只需要帮助用jQuery访问选择?
类似的东西:
$('#inputForm')
.on('change', '#datetimepickerto', function(){
console.log($(this).val());
}).on('change', '#testnames', function(){
console.log($(this).val());
}).on('change', '#usernames', function(){
console.log($(this).val());
}).on('change', '#platforms', function(){
console.log($(this).val());
}).on('change', '#res', function(){
console.log($(this).val());
});
答案 1 :(得分:0)