Updated

Can the cap and gown worn by high school graduates coexist peacefully with military uniforms worn by classmates destined for the armed services? Until recently, the answer in New Hampshire was no.

A law went into effect last month allowing graduates the opportunity to wear their uniform at commencement ceremonies if they have completed basic training. New Hampshire joins Pennsylvania and California, which passed similar laws in 2011 and 2009 respectively.

The debate about appropriate attire for a rite of passage is not as simple as it seems. The idea of military dress breaking up a uniform sea of school colors speaks directly to deeply held convictions about school spirit, patriotism, the role of the military and the significance of graduation.

"I would love for other kids to see this law and be motivated by it. I would like Brandon's Law to be an inspiration for other high school students to strive to succeed and be rewarded for it," said Jessie Kelley, mother of the young man killed in action for whom the New Hampshire law is named. "They are putting their lives on the lines, so I feel it's the least we could do."

Her son, Marine Lance Cpl. Brandon Garabrant, fought unsuccessfully to wear his uniform to his 2013 graduation from ConVal Regional High School. The school worried he would outshine his classmates and said the uniform represented achievements beyond the classroom.

Reaction was swift and fierce. Commenters raged on Facebook, with some even posting personal details about the principal who denied Garabrant and encouraging emails to him. Reporters camped out at graduation.

The brouhaha came into poignant focus when the 19-year-old was killed by a roadside bomb in Afghanistan the following summer.

In McHenry, Illinois, last month, Pvt. Megan Howerton was not allowed to walk in her graduation from McHenry West High School when, minutes before the ceremony, she asked to collect her diploma wearing her Marine Corp dress blues. She was told she would have to wear it under her gown, so she chose not to participate.

Her case inspired a hashtag, #letmeganwalk, with commenters split between those who felt her service should be recognized and those who argued she should follow school policy as rigidly as military protocol.

The Marine Corps Recruiting Station Chicago said in a statement that the decision was rightly left up to the school because "graduations recognize the academic accomplishments of the class and the class's final chapter at that institution."

In New Hampshire, Brandon's Law passed with none of the angry words that surrounded his bid. The concerns at legislative hearings included the impact it would have on a school's ability to set policy and a few complaints that uniforms would be a distraction.

Kate Williams, a family friend who cut Garabrant's hair for years, led the campaign and put a sign in her salon that said, "Brandon deserves to wear his uniform." Many community members couldn't understand why the school wouldn't make an exception, given what he was doing for the country, she said.

Brian Pickering, the principal at Garabrant's school, supports the new law. Even though he also got the blessing from Marines and other veterans for his decision, Pickering said, the threats he endured "nearly ruined my career and family."

"I'm thankful for the law because, at the time, there was no law," Pickering said. "There was nothing to fall back upon."

Colleges have also dealt with the issue. The Army ROTC at the University of New Hampshire, which covers nine universities, said students can wear military dress or their cap and gown.

So far this graduation season, only one New Hampshire high school student is known to have worn a military uniform during graduation — Michael Joy, of Prospect Mountain High School. But he wore it under his gown when he graduated Friday, opting instead for a red sash over his gown representing the Army National Guard.

Joy, who will be a member of the military police in the Guard, said he didn't want to stand out from his fellow seniors.

"I didn't want to make myself like, 'Oh, I'm better than you guys,'" Joy said. "It could be an opportunity to celebrate patriotism and stuff. But I feel like joining and actually serving, that is my way of showing patriotism. I don't have to wear the uniform to show people that I'm in the service."