You can donate on behalf of someone whether he is alive, or dead. For your loved ones, they will be rewarded in their graves and in the hereafter as It was a deed they have performed when they were alive.
“A man told the Prophet (saw) that his mother died a sudden death and did not have a chance to leave a bequest in her will, and that were she able to speak she would want to donate to charity. He then asked if the reward of charity on behalf of his deceased mother would reach her, to which the Prophet (peace and blessings be upon him) replied, “Yes.” [Muslim]
However, there is no difference between the opinion of the scholars concerning the charity being given on the behalf of the dead. Whoever wants to honour the deceased especially their parents must give charity on their behalf in order for them to benefit, and there is no difference of opinion among the Muslims concerning this point. This is the correct view.
Quran says about charity:
"Allah will deprive usury of all blessing but will give increase for deeds of
charity. For He loves not creatures ungrateful and wicked"
"Those who believe, and do deeds of righteousness, and establish regular prayers and regular charity, will have their reward with their Lord.”
Some people choose to make donations to a charity on their own accord, but others make donations on someone else’s behalf. For instance, a couple who is getting married and does not want gifts may ask that guests donate to a favourite charity in the couple’s name. Each organization or charity has its own protocol for making a donation on behalf of someone else, but the basic process is the same.
“When a man dies, his acts come to an end, but three, recurring charity, or knowledge (by which people) benefit, or a pious son, who prays for him (for the deceased)” [Muslim].
Yes, charity goes a long way! If for example, you build a well in this life, you’d be rewarded for every drop of water one consumes from the well, even after your death. In the same way, if you were to buy a chair for a mosque, you’d be rewarded every time someone sits on that chair, even after you depart. Or, if you were to build a mosque, you’d be rewarded for every prayer performed within the mosque.
In the light of the Quran and Hadiths, it has been proved that we can give charity on the behalf of someone else. As you can see, giving charity is full of beautiful benefits.
From the above answers you can see, giving sadaqah is full of beautiful benefits both for the self and others. Sadaqah does not decrease wealth, rather it adds blessings to our wealth, health, and lifestyle.
May Allah (SWT) grant us soft hearts that motivate us to do consistent acts of sadaqah.