A person takes a vow that if a certain wish or work of his is fulfilled, he will undertake to carry out a certain act of ibaadah. Once this wish or work of his is fulfilled, it will be wajib upon him to carry out the act of ibaadah which he vowed to carry out. If he does not fulfil this vow, he will be committing a great sin. [Behisti Zewar: Page 362]
A father says: “ O Allah! If my son passes his exams , I will keep five fast for Your pleasure.”
If the son passes his exams, the father WILL have to keep the 5 fasts. If the son does not pass - then the father will NOT have to keep the 5 fasts.