How about:
$('#myform').submit(function (event) {
event.preventDefault();
$.post($(this).attr('action'), $(this).serialize(), function(data, status)
{
// post callback function - $(this) is no longer 'myForm'
}
$(this).trigger('reset'); // trigger form reset after $.post()
}
What you would want to ensure is the form was successfully posted prior to the form reset, so maybe in the $.post() callback you could set a variable and then check that before triggering the reset.
Something like this:
var can_reset = false;
$('#myform').submit(function (event) {
event.preventDefault();
$.post($(this).attr('action'), $(this).serialize(), function(data, status)
{
// unsure if your response returns data.success - just an example
if (data.success == true) {
can_reset = true;
}
}
if (can_reset) {
$(this).trigger('reset');
}
}