2016-08-23 6 views
0

私のページには2つのフォームがあります。HTML複数の投稿

<form name="form1" action="" method="POST" autocomplete="off"> 
      <h3><span>Number : </span> 
       <span class="min-width"><select class="form-control" id="num" maxlength="255" name="num_selector" onchange="this.form.submit();" autofocus> 
<option value="0001" selected="selected">0001</option> 
</select></span> 
      </h3> 
</form> 

<form action="/enter" method="POST" name="form2"> 
     <input class="btn btn-default btn-orange has-spinner" type="submit" value="enter" name="enter"> 
</form> 

私はフォーム2のEnterボタンをクリックすると、同じURL(これはform1で定義されているもの)に投稿されます。 form1はform2の代わりに投稿されています。

答えて

0

java-scriptを使用して個別に送信できます。

document.getElementById( "myForm")。submit();

<input type="button" name ="enter" value="enter" OnClick="postData('FORMID')" /> 
function postData(formId){ 
    document.getElementById(formId).submit(); 
} 
+0

これは機能しません。それでも私の最初のフォームが掲載されています。 – ShanmugavelSubramani

+0

これは、たとえば、あなたのためにそれをカスタマイズする必要があります。 私はまだあなたのためにそれをコード化する必要がありますか? –

関連する問題