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