Live Validation

Last modified by Manuel Leduc on 2021/09/20

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.

Example 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" } );
// ]]>

Get Connected