Disciplining children on Shabbos:
It is permitted to discipline or punish children on Shabbos. One may thus lock a child in his room for disciplinary purposes. Nonetheless, it is possibly even Biblically forbidden to hit or spank a child if doing so can cause a bruise to the child. Furthermore, it is not in the spirit of Shabbos to show anger or fury, or give punishment even for the sake of Chinuch, as learned from the reason why the Torah prohibited a Beis Din from giving punishment on Shabbos. The Torah desired that Shabbos be a day of rest for all, even those who deserve punishment, and hence one is to abstain from punishing or showing any anger on Shabbos to the utmost extreme.
 Setimas Hapoksim as the above prohibition is only in reference to a Beis Din, or community, punishing or incarcerating an individual, and not to a parent who does so for educational purposes.
 Tzitz Eliezer 15:41 brought in Piskeiy Teshuvos 316:23
The trapping prohibition: There is no trapping prohibition involved in trapping humans. [Setimas Hapoksim in 339; Piskeiy Teshuvos 316:23] One may thus lock a child in his room if needed. [Tzitz Eliezer 15:41 brought in Piskeiy Teshuvos 316:23]
Other opinions: Some Poskim question that perhaps the trapping prohibition applies to a child. [Avnei Nezer 189:22 based on Tosafus Menachos 64a]
 Some Poskim suggest that perhaps giving lashes is Biblically forbidden because it may cause a wound, which is a Biblical prohibition, and is thus included in the Biblical prohibition against giving punishment. [Rambam 24:7 as explained in M”A ibid; M”A 278:1 in name of Turei Even 40 and Rashal regarding a fight that this applies even according to Rebbe Shimon who holds Eino Tzarich Legufa is exempt; P”M 339 A”A 3] However, in truth, perhaps it is only a Rabbinical prohibition, as it is a Melacha She’eiyno Tzarich Legufa and one has no intent to make a wound. [see Machatzis Hashekel on M”A ibid that he has no intent to make a wound; P”M ibid that the above Biblical prohibition only applies according to opinion of Eino Tzarich Legufa Chayav; Admur 316:16]
 Piskeiy Teshuvos 339:7