limiting number input
I have field "points" that shows value 30/30, and 3 other fields(C1,C2,C3) for entering values which then substracts from field "points".
How do I make it so field "points" can't go bellow 0, it only allow up to 0? for example if I want to enter 31 in field "C1" it
doesn't allow me.
INFO:
Field "points" have default value of 30 and use custom calculation script:
var a = this.getField("points").defaultValue;
var b = this.getField("C1").value;
var c = this.getField("C2").value;
var d = this.getField("C3").value;
var x = a-b-c-d;
event.value = x + "/30";
It doesn't allow me to enter "Field value is in range" which I could use to solve my problem, I can only enter custom validation script.
I also have 3 buttons each for fields C1,C2,C3 with dialog boxes where user input numbers which is then writed to fields C1,C2,C3.
I think that I need custom validation script for field "points" but not sure how to write one.
