JavaScript validation, javascript jquery mobile validation – hata kontrolü nasıl yapılır ?

Paylaş.

Merhabalar jquery ile client site hata kontrol örneğini sizler ile paylaşıyorum

http://jqueryvalidation.org/documentation

http://jquery.bassistance.de/validate/demo/

http://www.elijahmanor.com/jquery-mobile-form-validation/

 

 

<!DOCTYPE html>
<html>
<head>
<meta charset=”utf-8″>
<title>Ben bir javascript mobile hata kontrol – validation örneğiyim.</title>
<meta name=”viewport” content=”width=device-width, initial-scale=1″>
<link rel=”stylesheet” href=”http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css” />
<script src=”http://code.jquery.com/jquery-1.7.1.min.js”></script>
<script src=”http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js”></script>
<script src=”jquery.validate.js”></script>
<style>
label.error {
color: red;
font-size: 16px;
font-weight: normal;
line-height: 1.4;
margin-top: 0.5em;
width: 100%;
float: none;
}
@media screen and (orientation: portrait) {
label.error {
margin-left: 0;
display: block;
}
}
@media screen and (orientation: landscape) {
label.error {
display: inline-block;
margin-left: 22%;
}
}
em {
color: red;
font-weight: bold;
padding-right: .25em;
}
</style>
</head>
<body>
<div id=”page1″ data-role=”page”>
<div data-role=”header”>
<h1>Hoşgeldiniz.</h1>
</div>
<div data-role=”content”>
<form method=”GET”>
<div data-role=”fieldcontain”>
<label for=”email”>E-Posta:</label>
<input type=”email” name=”email” id=”email” />
</div>
<div data-role=”fieldcontain”>
<label for=”password”>Şifre:</label>
<input type=”password” name=”password” id=”password” />
</div>
<input data-role=”submit” type=”submit” value=”Giriş Yap” />
</form>
</div>
</div>
<script>
$(‘#page1’).bind(‘pageinit’, function(event) {
$(‘form’).validate({
rules: {
email: {
required: true
},
password: {
required: true
}
}
});
});
</script>
</body>
</html>

VN:F [1.9.22_1171]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)
JavaScript validation, javascript jquery mobile validation - hata kontrolü nasıl yapılır ?, 10.0 out of 10 based on 1 rating