submitラベル

1878 ワード

注:以下の内容はオリジナルですが、インスピレーションはネット上のエビの皆さんの文章に由来しています.ここでは一つ一つ明記しません.許してください.submitラベルとbuttonラベル
submitラベルはbuttonラベルの一種であり、buttonラベルの一例と言える.自動コミットという動作を統合している.一般的に、コミット後にJSチェックが必要な場合はtype='button'を使用し、onClickアクションで手動でコミットする必要があります.type='submit'でJSチェックを行うと、formテーブルのonSubmit()動作と組み合わせることができます.
------type=buttonタグ提出
<html>
 <head>
  <script>
    function onsubmit1(){
     fm.action='http://www.google.com';
     fm.submit();
     } 
  </script>
 </head>
 <body>
  <form  name='fm' method='get'><!--  Post , Google , Get -->
   <input type="button" name=" " value=" " nclick="onsubmit1();"><!-- onclick JS onsubmit();-->
  </form>
 </body>
</html>

-----type=submitで使用する場合、ターゲットurlはformテーブルのactionにソースコードを次のように標定する必要があります.
<html>
 <head></head>
 <body>
  <form  name='fm' method='get' action="http://www.baidu.com.cn">
   <input type="submit" name=" " value=" ">
  </form>
 </body>
</html>

----type=submitタグで提出する際にJSチェックを行いたい場合は、formテーブルのonsubmit方式でJSを呼び出すことができます
<html>
 <head>
 <script>
 function onsubmit2(){
  
  alert("Test....");
  } 
 </script> 
 </head>
 <body>
  <form  name='fm' method='get'  nsubmit="onsubmit2();">
   <input type="submit" name=" " value=" ">
  </form>
 </body>
</html>