0

I have this template where I customized whats on it BUT i got stuck on the contact page where the contact form upon clicking the button clear OR send button nothing happens. I really don't know much about most of the stuff ALL are from research through net but can't get to fix this. Am I missing something here?

Questions I have in mind: 1. Do I need to put something or create in "action" 2. What do I have to put in "href" to clear or send the form to my email?

Or you have a better idea.

<h2 class="p0">Contact Form</h2>
          <form id="contact-form" action="#" method="post" enctype="multipart/form-data">
            <fieldset>
              <label><span class="text-form">Name:</span>
                <input name="p1" type="text" />
              </label>
              <label><span class="text-form">Email:</span>
                <input name="p2" type="text" />
              </label>
              <div class="wrapper">
                <div class="text-form">Message:</div>
                <textarea></textarea>
              </div>
              <div class="buttons"> <a class="button-2" href="#">Clear</a> <a class="button-2" href="#">Send</a> </div>
            </fieldset>
          </form>
4

1 回答 1

0

使用真正的按钮,不要只给它们一个名为buttons.

action中,记下将处理此表单的服务器文件的名称,例如action="contact_form.php". 如果您想发送电子邮件,请放下action="MAILTO:someone@example.com"

<h2 class="p0">Contact Form</h2>

<form id="contact-form" action="MAILTO:someone@example.com" method="post" enctype="multipart/form-data">
    <fieldset>
        <label><span class="text-form">Name:</span>

            <input name="name" type="text" />
        </label>
        <label><span class="text-form">Email:</span>

            <input name="email" type="text" />
        </label>
        <div class="wrapper">
            <div class="text-form">Message:</div>
            <textarea name="message"></textarea>
        </div>
        <div class="buttons">
            <input type="button" value="Clear" onclick="document.getElementById('contact-form').reset()"
            />
            <input type="submit" value="Send" />
        </div>
    </fieldset>
</form>
于 2013-02-04T15:15:09.597 回答