LiveValidation UI Component

Version 2.3 by Manuel Smeria on 2013/01/22

XWiki bundles the LiveValidation library. You can read its examples or the full documentation on their website.

Exemple of use in XWiki

{{velocity output=false}}
$xwiki.jsfx.use('uicomponents/widgets/validation/livevalidation_prototype.js')
$xwiki.ssfx.use('uicomponents/widgets/validation/livevalidation.css')
{{/velocity}}
{{html}}
<form>
 <div>
   <input type="text" name="fruits" class="mandatory">  
 </div>
</form>
<script type="text/javascript">
// <![CDATA[
document.observe("dom:loaded", function(){
   var mandatoryInputs = $('mainContentArea').select('input.mandatory');
   for (var i=0;i&lt;mandatoryInputs.length;i++) {
     var input = mandatoryInputs[i];
     var valid = new LiveValidation( input, { validMessage: "OK!", wait: 500 } );
     valid.add( Validate.Presence, 
              { failureMessage: "Mandatory" } );
   }
});
// ]]>
});
</script>
{{/html}}

Get Connected