Remember that two vectors are perpendicular if their scalar/dot product is exactly zero.
The scalar product of two vectors a and b is given by |a||b|cos(θ) and also - if you have the two vectors as (a_{x}, a_{y}, a_{z}) and (b_{x}, b_{y}, b_{z}) - by a_{x}b_{x} + a_{y}b_{y} + a_{z}b_{z}.
Since it is given that the second vector must have no z-component, you can ignore the third term in calculating the scalar product:
a_{x}b_{x} + a_{y}b_{y} = 0