more work on CRM-12463, form building js fixes