我想使用这个验证表单
http://mootools.floor.ch/en/download/
但不工作。
<form name="niceform" id="third" action="" class="niceform" method="post" enctype="multipart/form-data">
<div class="titlu_form"> categoría: </div>
<div class="option_form">
<select name="categorie" id="categorie" class="validate['required']">
<option value=""> -- Elige categoría -- </option>
<option value="1"> 1 </option>
<option value="2"> 2 </option>
<option value="3"> 3 </option>
</select>
</div>
<div class="titlu_form"> provincia: </div>
<div class="option_form">
<select name="provincia" class="validate['required']">
<option value=""> -- Provincia -- </option>
<option value="Castellon"> Castellon </option>
<option value="Valencia"> Valencia </option>
</select>
</div>`
<div class="titlu_form"> marca: </div>
<div class="option_form">
<select name="marca12" id="marca" class="validate['required']">
<option value=""> -- Marca -- </option>
<option value="jeans"> jeans </option>
<option value="other"> other </option>
</select>
</div>
<input type="submit" name="Submit" />
</form>
这是我用于验证的脚本
<script type="text/javascript" src="lightform/mootools.js"></script>
<script type="text/javascript" src="lightform/formcheck.js"></script>
<script type="text/javascript">
//h
window.addEvent('domready', function(){
formcheck = new FormCheck('third', {
display : {
fadeDuration : 500,
errorsLocation : 1,
indicateErrors : 1,
showErrors : 1
}
})
//$('marca').removeAttribute('class');
formcheck.dispose($('marca'));
});
//and this is opcionaly for a select option
$('categorie').addEvent('change', function(event){
var selection = document.getElementById('categorie').value;
alert(selection);
if(selection==1) {
alert(selection);
formcheck.dispose($('marca'));
$('marca').removeAttribute('class');
}
});
</script>
导致此错误:
formcheck.dispose is not defined.
我想在选择选项 2 或 3 时隐藏 div marca .. 那是.. 这个怎么样..