晚上好 我正在开发应用程序,我的问题是更改选择选项后,我必须拥有一个自动计算的区域,我在您的网站上找到了我已改编的代码,但找不到结果希望有人可以帮助我谢谢你 代码如下:
<!DOCTYPE html>
<html lang="en">
<select class="select" name="origpro" onchange="calcul()">
<option></option>
<option value="acqui* coef * qotpart * 1.2">ACHAT</option>
<option value="acqui* coef* qotpart"> VENTE</option>
<option value="acqui* coef"> LOCATION</option>
</select>
<td valign="center"><input name="acqui" type="text" id="acqui" size="3" maxlength="5" >
<td valign="center"><input name="coef" type="text" id="coef" size="3" maxlength="5" >
<td valign="center"><input name="qotpart" type="text" id="qotpart" size="3" maxlength="5" >
<input type="text" name="total" value="">
<script>
function calcul(){
var origpro = document.getElementsByName("origpro")[0].value;
var coef = document.getElementsByName("coef").value;
var acqui = document.getElementsByName("acqui").value;
var qotpart = document.getElementsByName("qotpart").value;
document.getElementsByName("total")[0].value = origpro[0];
}
</script>
</html>