Server validate field based on value another select field
I have a problem with one form.
I have a select field1 that gets values from db.
Then, I have another field2 that must validate (number validation) based on the selection on the field1.
I cannot make it to work.
Here what I have done:
1. created a recordset that filters a table by form value (field1); this table contains a field containing the value that represent the max value I want to use for validation for field2; just call it value1);
2. created a number validation rule on field2; if the max value is higher than the value1 it must not pass validation.
Since I'm using DB2 I've set the max value for field2 as: $rs_myrecordset->getColumnVal("value1")
Is this right? or have I to use another syntax?
I'm sure the solution is not so far away.