Solution :

The number of triangles with vertices on sides $$AB,BC,CD = {\,^3}{C_1} \times {\,^4}{C_1} \times {\,^5}{C_1}.$$
Similarly for other cases.
∴ the total number of triangles
$$ = {\,^3}{C_1} \times {\,^4}{C_1} \times {\,^5}{C_1} + {\,^3}{C_1} \times {\,^4}{C_1} \times {\,^6}{C_1} + {\,^3}{C_1} \times {\,^5}{C_1} \times {\,^6}{C_1} + {\,^4}{C_1} \times {\,^5}{C_1} \times {\,^6}{C_1} = 342.$$