$("#myForm").ajaxForm({ type: "POST", url: "action.php", data: "msg="+msg+"&action=add", success: function(msg){ show_messages(); clearForm(); }