我是靠谱客的博主 正直石头,这篇文章主要介绍表单怎么根据不同条件提交到不同的页面,现在分享给大家,希望可以做个参考。

本章节介绍一下如何根据不同的情况使表单跳转到不同的页面,下面就通过一个例子做一下简单介绍。

代码实例如下:

<!DOCTYPE html>
<html>
<head>
<meta charset=" utf-8">
<meta name="author" content="http://www.softwhy.com/" />
<title>蚂蚁部落</title>
<style type="text/css">
body{
margin:0;
padding:0;
}
ul li{
list-style:none;
}
</style>
<script type="text/javascript">
window.οnlοad=function(){
var antzone=document.getElementById("antzone");
var qq=document.getElementById("qq");
var theform=document.theform;
antzone.οnclick=function(){
theform.action="http://www.softwhy.com";
theform.submit();
}
qq.οnclick=function(){
theform.action="http://www.qq.com";
theform.submit();
}
}
</script>
</head>
<body>
<form action="#" name="theform"/>
<ul>
<li>姓名:<input type="text" value="蚂蚁部落"/></li>
<li>密码:<input type="password" value="123456"/></li>
<li>
<input type="button" id="antzone" value="蚂蚁部落"/>
<input type="button" id="qq" value="腾讯集团"/>
</li>
</ul>
</form>
</body>
</html>

 

 

 

转自  http://www.softwhy.com/article-4320-1.html

如有侵权,请联系删除,谢谢

转载于:https://www.cnblogs.com/linguosen/p/10885499.html

最后

以上就是正直石头最近收集整理的关于表单怎么根据不同条件提交到不同的页面的全部内容,更多相关表单怎么根据不同条件提交到不同内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(93)

评论列表共有 0 条评论

立即
投稿
返回
顶部