Fix a bug in ajax forms validation