Did you try using the addRule function in the forms lib? http://docs.moodle.org/dev/Form_API
you should be able to add a server side or possibly a client side rule that does this for you.
Did you try using the addRule function in the forms lib? http://docs.moodle.org/dev/Form_API
you should be able to add a server side or possibly a client side rule that does this for you.