DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> CSS入門知識 >> CSS詳解 >> E-mail表單遞交,做個網站的反饋表挺好的
E-mail表單遞交,做個網站的反饋表挺好的
編輯:CSS詳解     

<!-- 把如下代碼加入<body>區域中 -->
 <script language="JavaScript">
<!--
function validate_form() {
  validity = true;
  if (!check_empty(document.form.NAME.value))
        { validity = false; alert('對不起!請你填入你的姓名。'); }
  if (!check_email(document.form.EMAIL.value))
        { validity = false; alert('對不起!請重新正確填入Email地址。'); }
  if (!check_empty(document.form.DESCRIPTION.value))
        { validity = false; alert('對不起!請你在"簡要描述"留言填入留言。'); }
  if (validity)
        alert ("                      謝謝你的來信.                                  "
                + "              你所填的信息將以Email形式發送給我,                      "
                + "              假如你認為本站內容不錯的話,請將本                       "
                + "              介紹給你的朋友,希望大家經常光顧本站。");
  return validity;
}

function check_empty(text) {
  return (text.length > 0);
}

function check_email(address) {
  if ((address == "")
    || (address.indexOf ('@') == -1)
    || (address.indexOf ('.') == -1))
      return false;
  return true;
}

// -->
</script>
<form name="form" method="post" action="mailto:web@knowsky.com?SUBJECT=網友的留言"
enctype="text/plain" onSubmit="return validate_form()">
              <table width="90%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="77%">
                    <div align="left"><font size="3"><b>

姓名:</b></font>
                      <input type="text" size=46 name="NAME">
                      <br>
                      <b><font size="3">Email地址: </font></b>
                      <input type="text" size=46 name="EMAIL">
                      <br>
                      <b><font size="3">URL地址: </font></b>
                      <input type="text" size=46 name="URL" value="http://">
                      <br>
                      <b><font size="3">留言內容:</font></b><br>
                      <textarea name="DESCRIPTION" rows=8 cols=45 wrap=virtual></textarea>
                    </div>
                  </td>
                </tr>
                <tr>
                  <td>
                    <div align="center"><br>
                      <input type="submit" name="submit" value="發送">
                      <input type="reset" value="清除" name="reset">
                    </div>
                  </td>
                </tr>
              </table>
              </form>
XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved