Many people are of the opinion that Islam encourages a person to make a vow to offer some worship ritual if his wish is granted. Thus a person pledges before God that he would, for example, keep a certain number of fasts or pray a certain amount of optional prayers if a certain desire of his is fulfilled.
It needs to be appreciated that making vows of worship for the fulfillment of certain wishes was never the way of the Prophet (sws) and his Companions (rta). It means that a person is imposing a condition to carry out certain virtuous deeds and also burdening himself with something which may ultimately be very difficult to fulfill. Worship done in this manner may also adversely affect a person’s relationship with his Creator. It becomes more of a mechanical act often done in disregard to the spirit of worship. Worship should be done from the willingness of the heart and from the eagerness of the soul, otherwise it will fail to reap the real benefit it carries: purification of the inner-self. In fact, worship done if one’s wish is not granted may at many times be more beneficial in achieving this end.
The correct way in this regard is to pray to the Almighty that a certain wish be granted. If the wish is granted, a person should express his gratitude by letting his feelings take their own course and manifest themselves in whatever form of worship at that particular time. Also, the quantity of worship does not matter in such cases: it is the quality that really counts.