Switch from custom id references to the element's id attribute. Extra fix to get rid of an unnecessary call to getValidationScript().
This is NOT YET PART OF THE MOODLE API it is here for experimental purposes.