Skip to main content link. Accesskey S

The useful resource for IBM Lotus Domino XPages development

Submit Search


Home > Validation form in Xpages with jquery
xpageswiki.com
is maintained by 
Julian Buss.
and hosted by laurus.ch.
Julian Buss
Created by Bartosz on 26.09.2016 14:50:42

Methods

noEmpty

lengthValidation

lengthValidationMinMax

attachment - must use: fileDownoload i fileUpload

notEmptyRichText - RichText field

lengthRichText - RichText field

Example (action on submit button, client side javascript)

var arr = [];

arr.push($('input[id*="field1"]').validation4form(['notEmpty',['lengthValidation','10']]));

arr.push($('textarea[id*="field2"]').validation4form(['notEmpty', ['lengthValidation', 10]]));

arr.push($('input[id*="field1_file"]').validation4form(['attachment']));

arr.push($('select[id*="field1_Select"]').validation4form(['notEmpty']));

arr.push($('textarea[id*="inputRichText1"]').validation4form(['notEmptyRichText',['lengthRichText','10']]));

$('input[id*="field12"]').validation4form(['notEmpty',['lengthValidationMinMax','10', '40']])

var valid = $.inArray( false, arr ) != -1 ? false : true;

return valid;

styleClass="btn btn-primary btn-lg"

rendered="#{javascript:form.isEditable()}">

submit="true" refreshMode="complete" immediate="false"

save="true">

arr.push($('input[id*="field1"]').validation4form(['notEmpty',['lengthValidation','10']]));

arr.push($('input[id*="field12"]').validation4form(['notEmpty']));

arr.push($('select[id*="field13"]').validation4form(['notEmpty']));

arr.push($('input[id*="field14"]').validation4form(['notEmpty']));

arr.push($('textarea[id*="field15"]').validation4form(['notEmpty', ['lengthValidation', 10]]));

arr.push($('input[id*="field1"]').validation4form(['attachment']));

var returnik = $.inArray( false, arr ) != -1 ? false : true;

return returnik;]]>