html表单的action属性如何定义多和地址??谢谢大家了!!
在一个form标签里有两个下拉表单,怎么用action来定义多个地址!??可以使下拉表单里的每个条件都能对应个自的地址!...
在一个 form标签里有两个下拉表单,怎么用action来定义多个地址!??可以使下拉表单里的每个条件都能对应个自的地址!
展开
1个回答
2013-09-04
展开全部
一个下拉框,和两个都是一样的,办法一样,看下面的例子,就你会了。
<html>
<head>
<script language = "JavaScript">
function a(x){
if (x == "button1"){
document.form1.action="url.jsp";
document.form1.submit();
}else if (x == "button2"){
document.form1.action="price.jsp";
document.form1.submit();
}else if (x == "button3"){
document.form1.action="same.jsp";
document.form1.submit();
}else if (x == "button4"){
document.form1.action="cancel.jsp";
document.form1.submit();
}else if (x == "button5"){
document.form1.action="mpn_same.jsp";
document.form1.submit();
}else if (x == "button6"){
document.form1.action="mpn_different.jsp";
document.form1.submit();
}else if (x == "button7"){
document.form1.action="title_new.jsp";
document.form1.submit();
}
}
</script>
</head>
<body>
选择你要比较的表名:
<form name="form1" method="post">
<select name="select1">
<option value="bizrate">bizrate</option>
<option value="nextag">nextag</option>
<option value="pricegrabber">pricegrabber</option>
<option value="pricewatch">pricewatch</option>
<option value="shopping">shopping</option>
<option value="verbatim">verbatim</option>
</select><br><br>
<input type="button" name="button1" value="判断链接" onclick="a(this.name)">
<input type="button" name="button2" value="更新总表" onclick="a(this.name)">
<input type="button" name="button3" value="查看重复code" onclick="a(this.name)">
<input type="button" name="button4" value="没有页面的code" onclick="a(this.name)">
<input type="button" name="button5" value="相似的mpn" onclick="a(this.name)">
<input type="button" name="button6" value="不同的mpn" onclick="a(this.name)">
<input type="button" name="button7" value="更新title" onclick="a(this.name)">
</form>
</body>
</html>
<html>
<head>
<script language = "JavaScript">
function a(x){
if (x == "button1"){
document.form1.action="url.jsp";
document.form1.submit();
}else if (x == "button2"){
document.form1.action="price.jsp";
document.form1.submit();
}else if (x == "button3"){
document.form1.action="same.jsp";
document.form1.submit();
}else if (x == "button4"){
document.form1.action="cancel.jsp";
document.form1.submit();
}else if (x == "button5"){
document.form1.action="mpn_same.jsp";
document.form1.submit();
}else if (x == "button6"){
document.form1.action="mpn_different.jsp";
document.form1.submit();
}else if (x == "button7"){
document.form1.action="title_new.jsp";
document.form1.submit();
}
}
</script>
</head>
<body>
选择你要比较的表名:
<form name="form1" method="post">
<select name="select1">
<option value="bizrate">bizrate</option>
<option value="nextag">nextag</option>
<option value="pricegrabber">pricegrabber</option>
<option value="pricewatch">pricewatch</option>
<option value="shopping">shopping</option>
<option value="verbatim">verbatim</option>
</select><br><br>
<input type="button" name="button1" value="判断链接" onclick="a(this.name)">
<input type="button" name="button2" value="更新总表" onclick="a(this.name)">
<input type="button" name="button3" value="查看重复code" onclick="a(this.name)">
<input type="button" name="button4" value="没有页面的code" onclick="a(this.name)">
<input type="button" name="button5" value="相似的mpn" onclick="a(this.name)">
<input type="button" name="button6" value="不同的mpn" onclick="a(this.name)">
<input type="button" name="button7" value="更新title" onclick="a(this.name)">
</form>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询