I have two related fields in a Yii model. They are items_per and items_period.
items_per is an integer that reflects how many items to be processed in a given time period.
items_period is the number of seconds in that period (a dropdown with options labelled as seconds, minutes, hours). Multiply items_per by items_period and you have "items per second".
I've got a custom validation rule set up to limit items per second being above a certain amount. That all works fine and gives a sensible error message using ajax validation when you change the value in the items_per field (on blur).
I need for the validation on the items_per field to be triggered whenever the items_period field is changed (100 / second may not be allowed, but 100 / minute is).
I tried adding an onchange function to the items_per dropdown to trigger "blur" or "change" on the items_per field, but it doesn't seem to make the ajax request for validation. Submitting the form just to trigger the validation isn't an option, as it's possible it might not have any errors and simply save the record before the user is ready.
Any suggestions how I can force one field to trigger ajax validation in another?