XWiki bundles the LiveValidation library. You can read its examples or the full documentation on their website. You may also be interested by the LiveValidation Macros extensions.

Exemple of use in XWiki

{{velocity output=false}}
  <input type="text" name="fruits" class="mandatory">  
<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" } );
// ]]>
Created by Vincent Massol on 2017/09/05

Get Connected