<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#my_form').validate();
})
</script>
<style type="text/css">
label {
display:block;
}
input {
display:block;
}
input.error {
border: 1px solid red;
}
</style>
</head>
<body>
<form id="my_form" action="" method="post">
<label>First Name</label>
<input id="my_firstname" class="required" minlength="2" />
<label>Last Name</label>
<input id="my_lastname" class="required" minlength="2" />
<label>Email</label>
<input id="my_email" class="required email" />
</form>
</body>
</html>
سوال برنامه نویسی دارید؟
ندونستن عیب نیست، نپرسیدن چرا!