1
0
-1

can someone help me and explain to me how can i use the BeanShell validator in my application even i read the documentation but i didn't understand anything. According to the documentation, there is a validate fonction from which we define the processing and we call it afterwards if I copy and paste to understand what it returns an exception appeared.

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Bean Shell scripting does require a basic/good understanding of Java.

      In summary, the Bean Shell Form Validator should return a boolean value, where 'true' indicates a correct value, while 'false' indicates an incorrect value and stops form submission and displays the usual form validation error to the end user.

      The sample script you tried in the Bean Shell Programming Guide KB page has sample Java variable(s) values (e.g.: form field IDs) that may not match the implementation of your form, and hence throwing the exception(s).
      Perhaps you can try out this super simple script below just to see how the form validation will behave.

      if (4 == 3) {
      	return true;
      } else {
      	return false;
      }
        CommentAdd your comment...