Janaba During the Fast
Question :

If I am fasting and I slept and had ejaculated semen, what do I do so my prayers will not be invalid?

Answer :

You should perform the ghusl of janaba before you can pray, and the fast is not affected.

Masturbation
Question :

Does masturbation during the month of Ramadan void the fast, if it does not end with ejaculation?

Answer :

If he intended to break the fast by such an act, his fasting is invalidated, whether or not ejaculation took place. He would then have to make it up later as qadha as well as pay the kaffarah. If he did not intend to break the fast, his fasting is not void. In any case, it is prohibited for the individual to masturbate even if it does not end with ejaculation. If one does so, he is required to seek the forgiveness from Allah Almighty and repent to Him.

Fasting and Masturbation
Question :

What is the ruling on masturbating during fasting of fasts other than the month of Ramadan, such as fasts obligated due to vows and non-obligatory fasts? Does masturbation also invalidate the non-Ramadan fasts?

Answer :

Masturbation is prohibited at all times, and invalidates all types of fast if semen is ejaculated.

Discharge of Semen after Fajr
Question :

I was fasting and after Fajr prayers some semen was discharged with urine. I performed the ghusl of janābah about three to four hours later. Is my fast valid?

Answer :

Your fast is in order.