I’m trying to do a validation on a form for each field like text field,date,input … in a form.I’m using 7.1.2 community edition?If we use groovy script where we have to use it in form and i want basic validations Please help me…
Add some javascript,
I did a search on google as follows javascript field validation and got loads of examples of how to do this…
should be easy to plug one of these into your pages.
regards
Sean
for this case, I would use a stupid approach to use 2 variables to show the errors:
-
isValid (javascript):
// pseudo code here;
var isValid = true; var errors = ; if ($data.date1 > $data.date2) {isValid = false; error.push(“rule 1”: “date1 larger than date2”);} // you may add other rules in this style
$data.validationErrors = errors;
return isValid; -
validationErrors (JSON):
Then you can display a text, setting hidden = {{isValid == true}} and value = validationErrors | json
Can you give me one example for any field step by step…
I have two date fields called ‘Start Date’ and ‘End Date’. I am looking for validation rule where I need to give error message
If I am not mistaken, there is inbuilt functionality in Bonita Studio.
@sony26kadaknachi - 1 - No sorry, I’ve not done this so you have to try it yourself…
@sony26kadaknachi - 2 - I just did a google search with this javascript date validation one greater than the other and found lots of examples how to do it…
@shpak.serhiy - Not at the form level there isn’t, you still have to provide your validation like in example 2 above
regards