Spacesuits are fitted with diapers so that astronauts can work outside for long hours (especially during spacewalks).
Toilets have various restrains (foot loops, thigh restraints, etc.) so that astronauts will not float away when he/she is using it. Also, due to weightlessness, the toilets rely on air and vacuum pump which creates suction to remove the waste. When urinating, astronauts use a large tube that is connected to the bottom front of the toilet. This tube also has air circulating through it carrying the urine to a holding tank. Anatomically correct urine funnel adapters are attached to this tube so that both men and women can use the same toilet. Here is a picture of a toilet in the space station.