Well, first start of with the code
JavaScript:
function keyevent(e) // submit key
{
if (e.keyCode == 13) // 13 = enter key
{
$(this).val("");
}
}
$(document).ready(function () {
$('#send').click(function() {
$('.message').val("");
});
});
HTML:
<input type="text" name="message" class="message" onKeyDown="javascript:keyevent(event);" />
<button name="send" id="send" onclick="refresh();" />Send</button>
Then I also have a if (isset($_POST[‘send’)) higher up on my page. But when I then see the message I sent, the messagebox is empty because the value of message didn’t exist.
So my question is, how do I “delay” the remove action? I have tried with delay()
Educated guess, what you need is this.
Javascript:
HTML: