Fix javascript validation and Rails handleRemote for forms.