<html>
<head>
<script type = 'text/javascript'>
function submit_forms () {
document.getElementById('submit1').click();
document.getElementById('submit2').click();
}
</script>
</head>
<body onload='submit_forms();'>
<form id = 'form_1' action = 'http://www.google.ru/' method = 'post' target = '_blank' onsubmit="alert('A')">
<input type = 'hidden' name = 'input_1'>
<input id=submit1 type = 'submit' value = 'Submit'>
</form>
<form id = 'form_2' action = 'http://www.google.ru/' method = 'post' target = '_blank' onsubmit="alert('B')">
<input type = 'hidden' name = 'input_2'>
<input id=submit2 type = 'submit' value = 'Submit'>
</form>
</body>
</html>