Detergent gives lather with hard and soft water both, while a soap gives lather with soft water only. Thus, it is not possible to check if water is hard; by using a detergent.
Your comment on this answer:
Related questions
Doubtly is an online community for engineering students, offering: