js 구현form 폼 비공식 검증

6202 단어 form
<!doctype html>

<html>

<meta content="utf-8">

<head>

<script language="javascript">

function checklogin()

    {

        if((myform.user.value!=""))

        {

            if((myform.pwd.value!=""))

            {

                return true

            }

            else

            {

                alert(" ");

                return false

                }

            }

        else

        {

            alert(" ");

            return false

            }

        }



</script>

<title></title>

</head>

<body>

<form action="form.html" name="myform" method="post" onSubmit="return checklogin()">



<input type="text" name="user" size="16"><br>

<input type="password" name="pwd" size="16"><input type="submit" value=" " name="sub_1">

</form>



</body>



</html>

 

좋은 웹페이지 즐겨찾기