cycle though elements in rule modal