รายละเอียดของการตอบ ::
ผมเพิ่มonclickไปที่ปุ่ม เพื่อที่จะให้ตอนเปิดมาครั้งแรกให้มันรันจาวาสคริปแล้วไปเรียกปุ่มsubmit2    แต่มันไม่ทำงานครับ
<html>
     <head> 
<script>
function test()
{
       alert("I am an alert box!");
}
</script>			
     </head>
     <body>
      <form action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post" id="myForm"  >           
            <input type="text" name="c" id="c">            
            <button type="submit" name="submit1" >submit1</button><br>
            <button type="submit" name="submit2" id="submit2" onclick="test();">submit2</button><br>			
      </form>
       <script type="text/javascript">
		document.getElementById('submit2').click(); 
		return false;		
	</script>
     </body>
    </html>