DialogParameters in 8.2 - how does validation works


I have 2 questions regarding new feature in 8.2 meaning DialogParameters. There are fields for validation scripts - do you have any examples of such scripts? What's the expected output and how can we refer to current value?

Second thing - how to execute such validation? I am thinking about using those new parameters without new portal and I got most of the basics working except value validation and calculation.

Thanks in advance,