diff --git a/templates/post.php b/templates/post.php
index 7b5c4b60da12cf9cfe71a903b78cdafe3c7f1991..323c39ceabd30ff385741fdc0e9e219f77e607ef 100644
--- a/templates/post.php
+++ b/templates/post.php
@@ -5,13 +5,17 @@
 	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
 	<title>POST data</title>
 </head>
-<body onload="document.forms[0].submit()">
+<body onload="document.getElementsByTagName('input')[0].click();">
 
 	<noscript>
 		<p><strong>Note:</strong> Since your browser does not support JavaScript, you must press the button below once to proceed.</p> 
 	</noscript> 
 	
 	<form method="post" action="<?php echo htmlspecialchars($this->data['destination']); ?>">
+	<!-- Need to add this element and call click method, because calling submit()
+	on the form causes failed submission if the form has another element with name or id of submit.
+	See: https://developer.mozilla.org/en/DOM/form.submit#Specification -->
+	<input type="submit" style="display:none;" />
 <?php
 if (array_key_exists('post', $this->data)) {
 	$post = $this->data['post'];