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 (ax, ay, az) and (bx, by, bz) - by axbx + ayby + azbz.
Since it is given that the second vector must have no z-component, you can ignore the third term in calculating the scalar product:
axbx + ayby = 0