国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

JS判斷不能為空實例代碼

2019-11-20 21:35:10
字體:
來源:轉載
供稿:網友
復制代碼 代碼如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html"; charset="utf-8">
        <title>短信系統</title>
<script language="javascript">       
        function formcheck(){
            if(document.form.zhanghao.value==""){
                alert("號碼不能為空!");
                this.form1.zhanghao.focus();
                return false;
            }else if(document.form.email.value==""){
                alert("內容不能為空!")
                this.form1.eamil.focus();
                return false;
            }else form1.submit(); 
}
        </script>
    </head>

    <body>
        <form name="form" method="post" action="sendmail.php" class="formg">
            <table>
                <h2>
                    <tr>
                        <th colspan="8" class="CTitle">發送短信</th>
                    </tr>
                </h2>

                <body>

                        <tr bgcolor="#eeeeee">
                            <td align="center">號   碼:</td>
                            <td><textarea name="content" cols="80" rows="15" id="zhanghao" class="formh"></textarea></td>
                        </tr>
                        <tr bgcolor="#eeeeee">
                            <td align="center">內   容:</td>
                            <td><textarea name="content" cols="80" rows="15" id="email" class="formh"></textarea></td>
                        </tr>

                        <tr bgcolor="#eeeeee" align="center">
                <td height="25" colspan="2">
                    <input type="button" name="Submit" value="發 送" class="button" onClick="javascript:formcheck();">      
                    <input type="reset" name="Submit2" value="重 置" class="button">
                </td>
                        </tr>
                </body>
            </table>
        </form>
    </body>
</html>
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 关岭| 吐鲁番市| 石棉县| 哈密市| 安平县| 乃东县| 淮阳县| 高州市| 化德县| 兴城市| 桐柏县| 中江县| 周至县| 永宁县| 织金县| 南丹县| 黔江区| 登封市| 阜阳市| 剑河县| 乌海市| 商水县| 库尔勒市| 青神县| 西宁市| 河北省| 綦江县| 岢岚县| 盖州市| 侯马市| 随州市| 武宁县| 西安市| 高碑店市| 安西县| 大连市| 石嘴山市| 河南省| 恩平市| 曲水县| 阿图什市|