In 1990, Hartnett was elected to the legislature in a politically mixed year in Texas, when the Democrat Ann W. Richards defeated Republican Clayton W. Williams Jr., for governor though early in the race Williams had garnered a large lead in public opinion polls. Three other Republicans were elected statewide that year, future Governor Rick Perry as Texas Commissioner of Agriculture, future U.S. Senator Kay Bailey Hutchison as state treasurer, and U.S. Senator Phil Gramm won reelection to the second of his three terms in that office by defeating the Democrat Hugh Parmer of Fort Worth. During Hartnett's tenure, he was either the chairman or vice-chairman of the House Judiciary Committee for fourteen years.[2] In 1998, he joined the Texas Conservative Coalition, a group of conservative lawmakers in both houses of the state legislature.[3] In 2001, Phyllis Schlafly's Eagle Forum rated Hartnett 93 percent, among the higher evaluations of Texas lawmakers.[4] By 2012, Eagle Forum rated Hartnett only 33 percent conservative. The same kind of decline, from 93 percent conservative in 2001 to 33 percent in 2012, also happened to Hartnett's colleague from Denton County, Burt Solomons.[5]
Representative Hartnett voted in 2006 to establish the Property Tax Relief Fund, a measure designed to reduce school district property taxes for maintenance and operation. He supported legislation to establish a minimum value for registration and tax purposes when an individual sells his own used vehicle to another. He supported legislation to allow an individual to use deadly force in self-defense. In 2007, he supported a pay increase for public school employees which excluded retirees. Hartnett voted to require photo identification for voting or the presentation of two non-photo ID cards to verify a person's identity. He voted with the House majority to reduce the fee for a marriage license from $60 to $30. Hartnett voted against casino gambling on Indian reservations; the measure died in the House on a 66-66 vote.[3]
In 2007, Hartnett supported legislation to permit religious expression in public schools. Signed into law by Governor Perry, the measure allows students to express their religious beliefs in classroom assignments, to organize prayer groups and other religious clubs, and permits speakers at school events such as graduation ceremonies to mention religious matters.[6]
In 2011, Hartnett voted to tax sales via the Internet if the company has a physical presence in Texas. Though the measure passed the House, 125-20, it was vetoed by Governor Perry. Hartnett voted to reduce funding for state agencies. He voted against a bill to ban texting while driving, another measure which Perry vetoed. He voted against a law signed by Perry which permits corporal punishment in public schools but only with parental consent. Hartnett voted with a House majority to ban smoking in most public places; cities may also limit smoking by local measures. He voted for an amendment offered in 2011 by conservative Representative Wayne Christian, who was defeated for re-nomination in 2012, to require public colleges and universities to fund student centers that promote family and traditional values. The amendment was approved by the House.[3]
Hartnett voted to restrict state funding to facilities which perform abortions, but he did not vote on the 2011 measure which requires women in Texas who procure abortions first to undergo an ultrasound to be informed of the progress in the development of the child.[3] He voted for legislation, passed 102-40 in the House and signed by Governor Perry, which authorizes a county, when determining eligibility for a "sponsored alien" under the Indigent Health Care and Treatment Act, to include in the resources of the applicant any additional incomes of their spouse and sponsor.[7]
Hartnett and his wife, the former Tammy Cotton, reside in Dallas. They have three sons.[2]