A good solution can be achieved by simply changing ad_form's element to element_1:integer(text).
That way, validation comes within the acs-template pkg.
This option would even reduce the amount of code within ad_form -on_submit, or ad_page_contract blocks.
Nevertheless, I wonder what would be necessary if I'd chosen JavaScript instead, separated from acs-template,
Best wishes,
Iuri