3
我最近添加了一个CSS3焦点样式到一个表单的元素(它垂直增长,给更多的空间来写)。然而,现在当用户点击提交按钮时,textarea会失去焦点(和缩小),但表单不会提交,用户必须再次点击提交。有没有解决这个问题的方法?HTML点击提交按钮两次
形式:
<form name="postForm" id="post_form" onsubmit="return validate()" action="post.php" method="post" enctype="multipart/form-data">
<textarea name="post" onkeydown="update()" onkeyup="update()" placeholder='Write Post...' id="post_area" ></textarea>
<div id='post_extras'>
<input class="admin_extra" id="post_button" type="submit" value="Post" />
<input class="admin_extra" type="file" name="file" />
<input class="admin_extra" placeholder="Image URL" type="url" name="url" />
<div class="admin_extra" id='char_left'>5000 Characters Left</div>
</div>
</form>
CSS:
#post_area{
height: 3em;
width: 100%;
display: block;
border: none;
box-sizing: border-box;
-moz-box-sizing:border-box;
-webkit-box-sizing:border-box;
padding: 10px;
margin: 0;
transition: height 1s;
-moz-transition: height 1s;
-webkit-transition: height 1s;
-o-transition: height 1s;
}
#post_area:focus{
height: 10em;
}
你能在这里发表您更新代码? – 2012-07-28 07:56:15