What is the validity or invalidity, under Sharee‘ah, of wrapping or shrouding the dead, male or a female, with a piece of cloth or banner carrying the speech of Allaah The Almighty or words of Tawheed, like those of Hamas or Islamic Jihaad or others having the words of Allaah The Almighty, be they complete Quranic Verses or parts thereof? What is the validity, under Sharee‘ah, of burying the dead in these, especially since many of them may probably be exposed to blood and filth which comes out of the dead body?
All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and messenger.
Writing anything from the Quran or Thikr on the shroud of the deceased or the wrapper which is wrapped over the shroud and is not buried in it was not done by the Prophet, sallallaahu ‘alayhi wa sallam, with any of the martyrs or anyone else. The Companions did not do this with the Prophet, sallallaahu ‘alayhi wa sallam, when he died in his shroud or the shroud of anyone else. This is not one of the things by which the dead are honored. Honoring the dead is to wash, shroud and bury his dead body according to the Sunnah. So, this is not valid under Sharee‘ah. It is also impermissible to bury the deceased in such things in order not to disgrace the speech and mention of Allaah The Almighty.
Ibn As-Salah was asked about this and he prohibited it. Here is the context of the question and answer: “A question about the shroud: ‘Is it permissible to write on the shroud any Soorah of the Quran say, Yaa-Seen, Al-Kahf or such or is it unlawful lest the pus of the deceased may flow on the Quranic verses and the blessed noble names of Allaah The Almighty? Is it permissible to place with him in the grave any stitched garment?’
The answer: ‘This is impermissible. Stitched clothing is permissible and so being shrouded in a shirt and Allaah The Almighty Knows best.’” [Fataawa Ibn As-Salah]
Commenting on this, Ibn Hajar Al-Haythami said, in his Al-Fataawa Al-Fiqhiyyah Al-Kubra: “Ibn As-Salah gave a fatwa that it is impermissible to write anything of the Quran on a shroud in order to maintain it from the pus of the deceased. The same impermissibility applies to such writing as they call Kitaab Al-‘Uhdah. The opinion of Ibn As-Salah was concurred by the Imaams after him. The meaning is very apparent. The Quran and exalted names as the Names of Allaah The Almighty and the names of His Prophets, may Allaah Exalt their mention, should be respected, venerated and exalted. Indeed, to write such and make it part of the shroud of the deceased means to disgrace it since no disgrace is greater than contamination. It is well known that anything placed in the shroud of the deceased is affected by his blood, pus or any such filth coming from his body. So, the prohibition of placing in the shroud of the deceased anything in which an exalted name is written is decisive.”
According to the statement of the learned scholar, Al-Jamal Ash-Shaafi‘i, “It is impermissible to write on it (i.e. the shroud) anything of the Quran or the exalted names (of Allaah The Almighty and His Prophets), in order to maintain them from pus and other such things.”
Whoever does so as you have mentioned in your question is expected to do it with a good intention and out of wishing for good. But, this alone is insufficient to make any deed valid under Sharee‘ah. Thus, it is due to follow what is valid, under Sharee‘ah, in the shroud of the deceased and give up what is unlawful.
Allaah Knows best.
You can search for fatwa through many choices