当我使用 post 方法iron-form
不起作用但 get 方法有效时。这是代码:
测试.php:
<script>
document.addEventListener("WebComponentsReady",function() {
document.querySelector("#form").addEventListener('iron-form-submit',function(e){
});
document.querySelector("#form").addEventListener('iron-form-response',function(e){
console.log(e);
});
document.querySelector("#form").addEventListener('iron-form-error',function(e,s,d){
console.log(e);
alert('iron form error!');
});
});
</script>
<body>
<form is="iron-form" id="form" method="post" action="/user/put">
<input name="address" required>
<input type="submit" value="submit" >
</form>
</body>
索引.php:
<?php
var_dump($_POST);
?>
当我提交网络标签中标题的表单截图时:
响应选项卡:
array(0) {
}