<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="widtd=device-widtd, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script src="jquery-validation-1.16.0/lib/jquery.js"></script>
<script src="jquery-validation-1.16.0/dist/jquery.validate.js">
我尝试了相同的代码,包括将jquery.js和jquery.validate.js包含在其他文件中,并且工作正常
<link rel="stylesheet" type="text/css" href="jquery-validation-1.16.0/demo/css/screen.css">
<link rel="stylesheet" type="text/css" href="./wrd_files/stilovi.css">
<title>WRD ispit</title>
</head>
<body>
<div id="wrapper">
<div>
<h1>Iznajmljivanje nekretnine</h1>
<hr />
</div>
<label>Odaberite vilu</label>
<div class="Kontejner">
<div class="VilaKolonaWrapper">
<img class="VilaKolonaOkvir" src="./wrd_files/team2.jpg" />
<h3>Villa Mostar</h3>
<h4>100 KM po danu</h4>
<p class="VilaOpis">Villa u odlicnom stanju. Na klizistu, nije puno presla. Uskoro u centru Mostara</p>
</div>
</div>
<div class="Kontejner">
</div>
<div id="zaFormu" style="">
<form id="kuki">
<label for="dostavaIme">Ime</label>
<input id="dostavaIme" />
<label for="dostavaAdresa">Adresa</label>
<input id="dostavaAdresa" placeholder="kupac adresa"/>
<label for="dostavaPostanskiBroj">Poštanski broj</label>
<input id="dostavaPostanskiBroj" value=""/>
<label for="dostavaTelefon">Telefon</label>
<input id="dostavaTelefon" placeholder="+387-61-888-8888"/>
<label for="napomena">Napomena</label>
<textarea id="napomena" style="width: 100%" ></textarea>
<br/>
<input type="button" value="Dodaj kupca" />
</form>
</div>
</body>
<script>
这个脚本可以在另一个文件上正常工作,但是不能使用这种形式(当我按下提交按钮时,即使我没有任何错误也没有任何反应) 我将不胜感激
$(document).ready(function(){
$("#kuki").validate(
{
rules:
{
dostavaIme:
{
required:true
}
},
messages:
{
dostavaIme:
{
required:"......"
}
}
});
});
</script>
</html>