欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

js實(shí)現(xiàn)表單多按鈕提交action的處理方法

 更新時(shí)間:2015年10月24日 11:35:11   投稿:lijiao  
這篇文章主要介紹了js實(shí)現(xiàn)表單多按鈕提交action的處理方法,需要的朋友可以參考下

之前一篇文章介紹了php實(shí)現(xiàn)表單多按鈕提交action的處理方法,今天再介紹一種js實(shí)現(xiàn)表單多按鈕提交action的處理方法,希望能夠幫助到大家。

用JS實(shí)現(xiàn)一個(gè)表單多個(gè)按鈕的方法,兩個(gè)onclick事件處理,代碼如下:

<html>  
<head>  
<script>  
  function submitit1()  
  //交由程序1處理    
  {  
    document.myForm.action = "http://www.site.com/cgi1.php"  
    document.myForm.submit();  
  }  
  function submitit2()  
  //交由程序2處理    
  {  
    document.myForm.action = "http://www.site.com/cgi2.php"  
    document.myForm.submit();  
  }  
</script>  
</head>  
  
<body>  
<form name="myForm" METHOD=POST>  
  username:<input type=text name=text1>  
  password:<input type=password name=text2>  
  <input type=button value="Submit1" onClick=submitit1();>  
  <input type=button value="Submit2" onClick=submitit2();>  
</form>  
</body>  
</html> 

大家可以結(jié)合前一篇《php實(shí)現(xiàn)表單多按鈕提交action的處理方法》一起學(xué)習(xí),可能效果會(huì)更好。

相關(guān)文章

最新評(píng)論