我正在使用下面的脚本,需要在前两个的基础上更改 3 下拉列表的值,如果我正在更改第一个下拉列表中的值,它目前显示相同的值。这是脚本---
<script type="text/javascript">
function changeprice(id){
var value = id;
if(value == ""){
document.getElementById('price').value="";
alert("Please select one valid word count");
return false;
}
if(value == "Lessthan1000"){
var newprice = "USD 290";
}
if(value == "Lessthan2000"){
var newprice = "USD 540";
}
if(value == "Lessthan4000"){
var newprice = "USD 1050";
}
if(value == "Lessthan6000"){
var newprice = "USD 1900";
}
var eprice = newprice;
document.getElementById('price').value = eprice;
}
</script>
<select name="sp" id="sp" class="servicecategory">
<option value="" selected>Please Select...</option>
<option value="Medical and Biomedical Manuscript Writing" <?php if($servicename == "Medical and Biomedical Manuscript Writing"){ echo(" selected=\"selected\""); } ?>>Medical and Biomedical Manuscript Writing</option>
<option value="Medical and Biomedical Manuscript Rewriting" <?php if($servicename == "Medical and Biomedical Manuscript Rewriting"){ echo(" selected=\"selected\""); } ?>>Medical and Biomedical Manuscript Rewriting</option>
</select>
<select name="Word_Count" id="Word_Count" onChange="changeprice(this.value)">
<option value="" selected>Please Select...</option>
<option value="Lessthan1000">1 - 1000 words</option>
<option value="Lessthan2000">1001 - 2000 words</option>
<option value="Lessthan4000">2001 - 4000 words</option>
<option value="Lessthan6000">4001 - 6000 words</option>
</select>
<tr>
<td valign="top" align="right">Price:</td>
<td width="5"></td>
<td valign="top" align="left"><input type="text" name="price" id="price" value="" readonly="" size="20"><br /></td>
</tr>
一旦我在第一个下拉列表中选择了医学和生物医学手稿重写,就需要更改该值。有什么建议现在该怎么做?它适用于医学和生物医学手稿写作——谢谢