How to validate two part of fields in same form?

Thanks for your reply.