1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| <script type="text/javascript" src="js/jquery/jquery-1.4.2.js"></script>
<script type="text/javascript" src="js/jquery/jquery.ui/js/jquery-ui-1.8.2.custom.min.js"></script>
<script type="text/javascript" src="js/jquery/jquery.validate/jquery.validate.js"></script>
<script type="text/javascript" src="js/jquery/jquery.defaultvalue/jquerydefaultvalue.js"></script>
<script type="text/javascript">
//Fonctions JQuery
$(function() {
//Valeurs par défaut des champs
$("#localisation").defaultvalue("Ville, Code Postal");
//Autocompletion
$("#localisation").autocomplete({
source: "include/villes.inc.php",
minLength: 2
});
$("#moteurForm").validate({
rules: {
localisation: {
required: function(element) {
return $("#localisation").val() != "Ville, Code Postal";
}
}
}
});
});
</script>
[...]
<label>Localisation</label>
<input id="localisation" name="localisation" type="text" class="defaultText text" /> |
Partager