如果下拉设置为“是”,任何人都可以帮我编写一些 JavaScript 来帮助我添加这两个字段吗?
示例:如果 txtoneside_slider = Yes,则将 txtoneside 值添加到总计中
如果 txttwoside_slider = Yes 然后将 txttwoside 值添加到总计中
小提琴示例:http: //jsfiddle.net/adder1999/rcU44/2/
<div id="onewindow">
<label for="txtoneside" class="editor-label"><strong>1 Side</strong></label>
<div align="right">
<input type = "text" name = "txtoneside" id="txtoneside" value = "45" />
<select name="txtoneside_slider" id="txtoneside_slider" data-role="slider" data-mini="true" />
<option value="no">No</option>
<option value="yes">Yes</option>
</select>
</div>
<div id="onewindow">
<label for="txtoneside" class="editor-label"><strong>2 Side</strong></label>
<div align="right">
<input type = "text" name = "txttwoside" id="txtoneside" value = "25" />
<select name="txttwoside_slider" id="txttwoside_slider" data-role="slider" data-mini="true" />
<option value="no">No</option>
<option value="yes">Yes</option>
</select>
</div>
<div id="grandtotal">
<label for="txtgrandtotal" class="editor-label"><strong>JOB TOTAL</strong></label>
<div align="right">
<input type = "text" name = "txtgrandtotal" id="txtgrandtotal" value = "" />
</div>
</div>