Validation javascript using type

I have a form which contains multiple inputs with type ‘text’ and ‘radio’ buttons, and i’m trying to validate all these fields using javascript.

Know that the id’s and names came from database .

so i want to validate by type.

Please anyone help me as fast as possible
thank you