As of 1 June 2015, all children under the age of 18 years who travel in or out of South Africa need the consent of both parents and their unabridged birth certificate stating both parents' names. If the child is traveling with only one parent, they must also have an affidavit filled out by the parent that is not present.
The Department of Home Affairs immigration services has equivalent forms for foreign children available online:
If a child applies for a visa inside South Africa or at a South African embassy abroad, all supporting documents must be submitted before the visa is issued.
If a child is a national of a country exempt from South African visas, all the supporting documents must be presented at a port of entry, or the child will be refused entry. The Department of Home Affairs lists all the countries exempt from South African visas.
You can download the form here.