Franklin Pierce served in the Mexican-American War. He achieved the rank of Brigadier General. He was reportedly a good commander but his reputation was damaged at the Battle of Churubusco.
Here is how Wikipedia reports this:
His brigade was designated the 1st Brigade in the newly created 3rd Division and joined Scott's army in time for the Battle of Contreras. During the battle he was seriously wounded in the leg when he fell from his horse. He returned to his command the following day, but during the Battle of Churubusco the pain in his leg became so great that he passed out and had to be carried from the field. His political opponents used this against him, claiming that he left the field because of cowardice instead of injury.
This became a huge political liability for Pierce during the Presidential Election of 1852. Nathaniel Hawthorne (a good friend of Pierce) wrote a campaign biography of the future president titled The Life of Franklin Pierce. In Chapter Five, he describes how Pierce handled the war injury at the Battle of Churubusco:
The commander-in-chief had already heard of the accident that befell Pierce the day before; and as the latter approached, General Scott could not but notice the marks of pain and physical exhaustion, against which only the sturdiest constancy of will could have enabled him to bear up. "Pierce, my dear fellow," said he,--and that epithet of familiar kindness and friendship, upon the battle field, was the highest of military commendation from such a man,--"you are badly injured; you are not fit to be in your saddle." "Yes, general, I am," replied Pierce, "in a case like this." "You cannot touch your foot to the stirrup," said Scott. "One of them I can," answered Pierce. The general looked again at Pierce's almost disabled figure, and seemed on the point of taking his irrevocable resolution. "You are rash, General Pierce," said he; "we shall lose you, and we cannot spare you. It is my duty to order you back to St. Augustine." "For God's sake, general," exclaimed Pierce, "don't say that! This is the last great battle, and I must lead my brigade!" The commander-in-chief made no further remonstrance, but gave the order for Pierce to advance with his brigade.
The way lay through thick standing corn, and over marshy ground intersected with ditches, which were filled, or partially so, with water. Over some of the narrower of these Pierce leaped his horse. When the brigade had advanced about a mile, however, it found itself impeded by a ditch ten or twelve feet wide, and six or eight feet deep. It being impossible to leap it, General Pierce was lifted from his saddle, and, in some incomprehensible way, hurt as he was, contrived to wade or scramble across this obstacle, leaving his horse on the hither side. The troops were now under fire. In the excitement of the battle, he forgot his injury, and hurried forward, leading the brigade, a distance of two or three hundred yards. But the exhaustion of his frame, and particularly the anguish of his knee,--made more intolerable by such free use of it,--was greater than any strength of nerve, or any degree of mental energy, could struggle against. He fell, faint and almost insensible, within full range of the enemy's fire. It was proposed to bear him off the field; but, as some of his soldiers approached to lift him, be became aware of their purpose, and was partially revived by his determination to resist it. "No," said he, with all the strength he had left, "don't carry me off! Let me lie here!" And there he lay, under the tremendous fire of Churubusco, until the enemy, in total rout, was driven from the field.
Hawthorne has made Pierce's collapse during the battle sound heroic. Further, his 1852 political opponent for the presidency (Winfield Scott) is portrayed as having begged Pierce to leave the battle with Pierce refusing! This is very good political propaganda. Hawthorne did a good job.