2016-12-04 3 views
-3

誰かがこれを修正する方法があれば私のフォームのコードは素晴らしいです。ここでなぜ私のHTMLフォームは電子メールに送信されないのですか、必要なときに送信しませんか?

\t <form id="rendered-form"> 
 
     <div class="fb-text form-group field-name"> 
 
     \t <label for="name" class="fb-text-label">Name <span class="required">*</span> </label> 
 
     \t <input type="text" required="" class="form-control name" name="name" id="name" aria-required="true"></div> 
 
     <div class="fb-email form-group field-email"> 
 
     \t <label for="email" class="fb-email-label">Email <span class="required">*</span> </label> 
 
     \t <input type="email" required="" class="form-control email" name="email" id="email" aria-required="true"></div> 
 
     <div class="fb-text form-group field-phone"> 
 
     \t <label for="phone" class="fb-text-label">Phone Number </label> 
 
     \t <input type="text" class="form-control phone" name="phone" id="phone"></div><div class="fb-undefined form-group field-message"> 
 
     \t <label for="message" class="fb-textarea-label">Message <span class="required">*</span> </label> 
 
     \t <textarea type="textarea" required="" rows="5" class="form-control message" name="message" id="message" aria-required="true"></textarea></div> 
 
     <div class="fb-submit form-group field-button-1480832953294"><button type="submit" class="button-input btn btn-warning" name="button-1480832953294" style="warning" id="button-1480832953294">CONTACT US</button></div></form> 
 
</div>

新しいコードは、私はちょうどそれを更新している、それはまだ仕事をdoesntの、です。

<div data-form-alert="true"> 
    <div hidden="" data-form-alert-success="true" class="alert alert-form alert-success text-xs-center">We will contact you as soon as possible!</div> 
    </div> 
    <form id="rendered-form" action="mailto:[email protected]" method="post"> 
     <div class="fb-text form-group field-name"> 
      <label for="name" class="fb-text-label">Name <span class="required">*</span> </label> 
      <input type="text" required="" class="form-control name" name="name" id="name" aria-required="true"></div> 
     <div class="fb-email form-group field-email"> 
      <label for="email" class="fb-email-label">Email <span class="required">*</span> </label> 
      <input type="email" required="" class="form-control email" name="email" id="email" aria-required="true"></div> 
     <div class="fb-text form-group field-phone"> 
      <label for="phone" class="fb-text-label">Phone Number </label> 
      <input type="text" class="form-control phone" name="phone" id="phone"></div> 
     <div class="fb-undefined form-group field-message"> 
      <label for="message" class="fb-textarea-label">Message <span class="required">*</span> </label> 
      <textarea type="textarea" required="" rows="5" class="form-control message" name="message" id="message" aria-required="true"></textarea> 
     </div> 
     <div class="fb-submit form-group field-button-1480832953294"> 
      <button type="submit" class="btn btn-primary">CONTACT US</button> 
     </div> 
    </form> 
+1

アクションは、フォーム定義にありません:実際には、あなたのformタグには何も入れて、あなたのページがhttp://myhost.com/mypageで発見されたと仮定しないで、あなたは実際にこの同等のものを使用しています。 – Sid

+0

に送信するフォームタグ(url/action)に定義していませんか? – sa77

答えて

0

あなたはそれがPHPである必要はありませんが、それはaction属性を作成する方法の例ですアクション

<form action="example.php" method="post"> 

を通して、あなたのフォームを送信する必要があります。

+0

あなたはそうですが、アクションはPHP拡張である必要はありません。これは単にサーバが理解できるどんなアクションでもあり、テクノロジースタックは重要ではありません。 – Sid

+0

ああ、私に知らせてくれてありがとう:)私はそれが動作するようにPHPファイルでなければならないと思った。 – Seydie

0

<form method="post"> 
    ... 
</form> 

にデフォルトの方法がgetあるとしてデータを掲示するために、あなたは、あなたのformタグでmethod="post"を置く必要があります。

投稿URLが現在のURLと同じ場合は、action属性は不要です。

<form action="http://myhost.com/mypage" method="get"> 
    ... 
</form> 
関連する問題