Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Passing more than 1 argument to error message  RSS feed

 
Imre Tokai
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,


I'm adding errors to via:

and i don't know how to pass more than 1 argument?


If error message is: "{0} must be unique", contains the value that will replace {0}.
But what if I want to have error message: "{0} must be greater than {1}"?
How to pass the argument that will replace {1}?


Regards


 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try adding two arguments in the same 'Field' object

http://commons.apache.org/validator/api-1.3.1/org/apache/commons/validator/Field.html#addArg(org.apache.commons.validator.Arg)

field.addArg(); // {0}
field.addArg(); // {1}
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!