您的位置:首页 > 其它

form 的submit提交没有反应

2016-04-18 10:18 435 查看
搞了一天,submit提交就是没有反应,原来是标签用错了。

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>Insert title here</title>

</head>

<body>

<h:form id="form1" action="goto.html" method="post">
input text :<input type ="text" name ="info" id="text"/>

<input type="submit" name="submit" value ="show" />
</h:form>

</body>

</html>

做如下修改后,即可正常提交 submit。原因是 <h:form> 是属于jsf框架的标签,通过<h:commonbutton>来提交表单,<form>是属于html的标签,通过  type=submit 来提交表单。

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>Insert title here</title>

</head>

<body>

<form id="form1" action="goto.html" method="post">
input text :<input type ="text" name ="info" id="text"/>

<input type="submit" name="submit" value ="show" />
</form>

</body>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: