Many plotholders have had problems with their onions this year. The leaves have become distorted and do not grow upright but may lie along the ground instead. Also the bulbs become swollen and distorted. This damage is probably caused by stem and bulb eelworm (also known as onion eelworm) This link to the RHS gives a full description of this disease.
There is no way of treating the onions once they get infected. You should not plant onions on this soil for at least 3 years. The diseased onions should not be put onto the compost heap. Eelworm is prevalent in spring-sown onions when there is a cold and wet May, like we have had this year.
Another problem that may affect onions is allium leaf miner. This is caused by the larvae of the leaf miner which is a fly that lays its eggs near the base of the onion bulb. The distinguishing symptom of leaf miner damage is a distinctive line of white dots on the foliage, which becomes distorted and may grow flat along the soil.
Once a plant is infected by leaf miner there is nothing that can be done and the plant should be destroyed. The best method of preventing leaf miner is to prevent the fly from laying its eggs on or near the onions in the first place. This could be done by using an insect-proof fleece/mesh to cover the onion sets or by planting the sets after the danger period for leaf miner has passed .
Read the following article for more details on the allium leaf miner and how to prevent it: Allium Leaf Miner