Hindering Prosecution in Arizona: A.R.S. 13-2512
Charged with hindering prosecution for helping someone the police wanted? Under A.R.S. § 13-2512, assisting a felon can be a class 5 felony, and the state must prove you acted with the specific intent to shield that person from arrest. A neutral act is not enough. Get your defense reviewed.
As Seen On

Recognized By
Featured Answer
What is hindering prosecution in Arizona?
Hindering prosecution in Arizona means knowingly rendering assistance to help someone avoid arrest, prosecution, or punishment. Under A.R.S. 13-2512, doing so for a felony is a class 5 felony (class 3 if it involves murder, terrorism, or a gang). Doing it for a misdemeanor is a class 1 misdemeanor under A.R.S. 13-2511.

Hindering prosecution is one of those charges that catches ordinary people off guard. You were not the one accused of the robbery, the assault, or the drug sale. You just did something that, in the eyes of a Maricopa County prosecutor, helped that person stay out of reach of the police. Maybe you let a friend crash at your place. Maybe you told an officer you had not seen your brother in weeks. Arizona treats that kind of conduct as its own crime, and depending on what the other person was accused of, it can be a felony. This guide explains exactly what the statute requires, where the felony line sits, and how these cases are actually defended in Arizona courts. For the broader picture of how we handle serious charges, start with our criminal defense overview.
Hindering prosecution is defined in two statutes that work together. Under A.R.S. 13-2512, a person commits hindering prosecution in the first degree if, with the intent to hinder the apprehension, prosecution, conviction, or punishment of another person for any felony, they render assistance to that person. A.R.S. 13-2511 is the mirror image for misdemeanors and petty offenses. In both, the crime is not committing the underlying offense yourself. It is helping the person who did, or who is accused of it, escape the reach of the justice system.
Two elements have to line up before the state can convict. First, there has to be a genuine act of assistance, and Arizona defines that assistance narrowly in a separate statute we cover below. Second, and this is where many cases fall apart, you have to have acted with the specific intent to hinder that person’s apprehension or prosecution. A neutral act done for an innocent reason is not enough. The prosecutor has to prove you meant to shield the person from the law, which is a demanding standard when the evidence is nothing more than a phone call, a ride, or a place to sleep.
What “rendering assistance” actually means
The phrase “renders assistance” is not left to a jury’s imagination. A.R.S. 13-2510 lists the exact ways a person can render assistance, and if your conduct does not fit one of them, it is not hindering prosecution. Under the statute, you render assistance by knowingly:
- Harboring or concealing the other person, for example hiding them in your home or garage.
- Warning the other person of impending discovery, apprehension, prosecution, or conviction, such as tipping them off that police are on the way. Warnings meant to get someone to comply with the law are specifically excluded.
- Providing the means to escape, including money, transportation, a weapon, a disguise, or other similar means of avoiding discovery or arrest.
- Obstructing by force, deception, or intimidation anyone from doing something that might help catch or convict the person.
- Suppressing physical evidence by concealing, altering, or destroying it, like wiping a phone or getting rid of clothing.
- Concealing the identity of the other person, for instance giving police a false name for them.
Notice the word “knowingly” runs through the entire definition. You cannot accidentally harbor a fugitive under Arizona law. You have to know the person is wanted or accused, and then choose to act in one of these listed ways to keep them out of reach. That knowledge requirement is often the difference between a charge that sticks and one that never should have been filed.
First degree vs. second degree: the split
The single most important factor in a hindering prosecution case is the level of the underlying offense the other person was facing. That one fact decides whether you are looking at a felony or a misdemeanor on your own record. If the person you allegedly helped was wanted for a felony, you are charged under A.R.S. 13-2512 with hindering prosecution in the first degree, a class 5 felony. If they were wanted for a misdemeanor or petty offense, you fall under A.R.S. 13-2511, hindering in the second degree, a class 1 misdemeanor. There is also an elevated tier: if you knew or had reason to know the felony involved terrorism or murder, or you acted to assist a criminal street gang, first-degree hindering jumps to a class 3 felony.
Hindering prosecution: first degree vs. second degree
Sources: A.R.S. 13-2512 (first degree) and A.R.S. 13-2511 (second degree)
This table shows the classification line only, not the full sentencing range. Actual exposure depends on your criminal history and other factors, so verify current figures against the linked statutes and speak with an attorney about your case.
How it differs from accessory and facilitation
People use “accessory after the fact,” “facilitation,” and “hindering prosecution” as if they were interchangeable. In Arizona they are not. Hindering prosecution under A.R.S. 13-2512 is the state’s version of what other places call accessory after the fact: helping someone escape justice after a crime has occurred. The focus is on shielding the person from law enforcement, not on the crime itself.
Facilitation under A.R.S. 13-1004 is a different animal. It punishes providing someone with the means or opportunity to commit an offense, and it happens before or during the crime, not after. Accomplice liability under A.R.S. 13-301 goes further still, treating a helper as if they committed the crime themselves. The practical takeaway is that hindering prosecution generally carries less exposure than being charged as an accomplice to the underlying felony, which is one reason charging decisions in these cases matter so much. If police believe you were involved in a violent offense rather than merely helping afterward, the stakes change dramatically, and our Phoenix violent crimes lawyer page explains how those cases are defended.
Common Maricopa County scenarios
Almost every hindering prosecution case we see grows out of a relationship. These are not calculated crimes; they are reactions. Understanding the typical fact patterns helps explain why the intent element is so often the battleground.
Helping a family member
A parent lets an adult child who has a warrant stay in the house. A sibling gives a brother a ride knowing police are looking for him. Loyalty is not a defense on its own, but the state still has to prove you acted with intent to hinder, not simply out of a family relationship that would exist regardless.
Lying to police about someone’s whereabouts
An officer knocks and asks if the person they are looking for is inside, and you say no. If you knowingly concealed their presence or identity to keep them from being arrested, that can be charged as rendering assistance. But an honest mistake, a refusal to answer, or simply not knowing where the person actually was is not the same thing as a knowing lie designed to hinder.
Getting rid of something after the fact
Someone hands you a bag, a phone, or clothing and asks you to hold it or throw it away. If you did not know it was evidence of a crime, you did not knowingly suppress physical evidence. These cases frequently turn on what you actually understood at the moment, which is rarely as clear as a police report makes it sound. How officers developed their suspicion in the first place often matters, and our explainer on probable cause versus reasonable suspicion covers why.
Defenses to a hindering prosecution charge
Because hindering prosecution requires both a specific act of assistance and a specific intent, there are several places to attack the charge. The right defense depends on the facts, but these are the ones that come up most often in Arizona courts.
- No knowledge. The statute requires that you knowingly rendered assistance. If you did not know the person was wanted, accused, or that what you handled was evidence, a core element is missing.
- No intent to hinder. You may have done something that incidentally helped the person, but without the intent to hinder their apprehension or prosecution, it is not a crime. Giving a ride for an ordinary reason is not the same as helping someone flee.
- Mere presence or association. Being in the same house, car, or friend group as a wanted person is not rendering assistance. The state cannot convert your proximity into an affirmative act.
- The conduct does not fit A.R.S. 13-2510. If what you did is not one of the specific listed forms of assistance, it is not hindering prosecution, no matter how the report characterizes it.
- Spousal and relationship issues. The dynamics between spouses and close family can complicate both what was said and what was intended, and they often affect how a case is charged and resolved.
- Constitutional problems. If your statements came from an unlawful stop, a coercive interrogation, or a search that violated your rights, that evidence may be suppressed.
None of these guarantees a particular result, but they explain why a hindering charge is often far more defensible than it first appears. The question is usually not whether you helped, but whether the state can prove you knew and intended what the statute requires.
Realistic outcomes in Arizona courts
In Maricopa County, first-time hindering prosecution charges frequently have room to move. Prosecutors know these cases hinge on intent and knowledge, and when that proof is thin, the leverage shifts. A class 5 felony hindering charge can sometimes be negotiated down to a misdemeanor, resolved through a diversion-style program for eligible people with no record, or reduced when the underlying offense the other person faced turns out to be weaker than first alleged. Because the classification rides on that underlying offense, undercutting it can pull the whole hindering charge down with it.
Sentencing exposure also depends heavily on your own criminal history, since Arizona’s felony sentencing ranges expand with prior convictions. That is why two people charged with the same conduct can face very different outcomes. Whether to fight the charge or resolve it is a decision that should be made with real information, and our guide on whether to take a plea bargain in Arizona walks through how to think about that choice. The point is that a hindering charge, especially a first-degree felony built on a single ambiguous act, is rarely as fixed as the initial paperwork suggests.
How Tamou Law Group approaches these cases
We start by separating what you actually did from what the report claims you intended. That means pinning down exactly which form of assistance under A.R.S. 13-2510 the state is relying on, then testing whether the evidence really shows you knew the person was wanted and meant to hinder their case. We also look hard at the underlying felony, because if it is shaky, the hindering charge that depends on it is shaky too.
Our team of former prosecutors, law enforcement officers, and public defenders has worked both sides of cases like these in Maricopa County courts. We know how these charges get built and where they tend to break. If police are still investigating and have not filed anything, the most valuable thing we can do is get involved before you give a statement that turns a witness into a defendant.
Award-Winning Criminal Defense Law Firm
When you are looking for the best Phoenix criminal defense lawyers, these are the independently verified credentials that matter, earned by Founding Attorney Michael Tamou and a full team of attorneys, including former prosecutors.
Client reviews
What our clients say
I highly recommend Michael Tamou! He recently handled my GCE application, and I couldn't be more grateful for his help. From the very beginning, Michael was incredibly professional, knowledgeable, and thorough in making sure everything was completed perfectly. What stood out the most was his compassion—legal processes can be highly stressful, but he treated me with genuine care, kept me informed, and made me feel completely supported throughout. If you need a dedicated and skilled attorney who truly cares about his clients, look no further than Michael Tamou.
DMDan MillerGoogle review · Oct 2026Michael Tamou is an exceptional attorney! Facing a case that could affect my future was incredibly stressful, but from our first conversation, he provided honest guidance, reassurance, and a clear plan. He immediately got to work, personally reviewing the evidence and reports, filing the necessary motions, and keeping me informed throughout the process. His expertise, persistence, and genuine care gave me confidence that my case was in capable hands. I’m incredibly grateful that Michael achieved the outcome I had hoped and prayed for: my case was dismissed. I highly recommend him to anyone seeking a skilled, dedicated, and caring attorney.
TJTammy JohnsonGoogle review · Sep 2026I had a great experience working with Michael. From the beginning, they were professional, knowledgeable, and responsive. They took the time to explain everything clearly, kept me informed throughout the process, and always had my best interests in mind. Their dedication and attention to detail gave me confidence during a stressful time, and they achieved a positive outcome for my case. I truly appreciate their hard work and would highly recommend them to anyone looking for an experienced and trustworthy attorney. Thank so much Tamou Law Group.
AAAlejandra ArevaloGoogle review · Aug 2026This is a great group of attorneys that work together!! There’s no other law firm I’d use for any situation. They put the time and effort into helping out any way they can. Mike and Kristie were both amazing in handling my situation and being transparent during the whole process.
TTJ2KGoogle review · Nov 2026I can’t thank Tamou Law Group enough for helping me with my case. They truly went above and beyond, and I’m incredibly grateful for their hard work, dedication, and support. Having a team in your corner that cares makes all the difference during a stressful time. Five stars don’t feel like enough! I highly recommend them to anyone looking for a law firm that will go the extra mile. Thank you for everything!
EGEvan GibraelGoogle review · Oct 2026I cannot recommend Ms. Jacie Cotterell highly enough. From start to finish, she was absolutely amazing throughout the entire process. She was professional, knowledgeable, and always took the time to answer my questions and explain everything clearly, which gave me a lot of peace of mind during a stressful situation. What stood out most was how genuinely caring and dedicated she was. I always felt like she had my best interests at heart, and her communication was excellent every step of the way. She made a difficult experience much easier to navigate and was always patient, supportive, and reassuring. I am incredibly grateful for all of her hard work and guidance. If you’re looking for someone who is compassionate, trustworthy, and truly committed to helping her clients, I wholeheartedly recommend Ms. Jacie Cotterell. Thank you again for everything, wyou made a lasting positive impact, and I truly appreciate all that you did.
BPBlaze PeralesGoogle review · Aug 2026Michael is hands down the best in the business. The day I called him he explained everything about my daughter’s situation and took the time to research the charges. He then gave me a price and gave me a chance to think it through before hiring him and two weeks later we retained his services. Michael went to work at that point with his team and brought results that no one else could do. My daughter now has a second chance to get her life on track over a few costly mistakes that could have landed her in prison and with a felony record but Michael did not allow that to happen. If you need solid representation that fights for you then hire Michael.
RHrob hardeeGoogle review · Aug 2026Kristie & Mike didn’t just see me as another client but as a person in need of help. The level of professionalism & communication going through my whole case made me feel at peace. Amazing lawyers & 10/10 would recommend!
DNDanny NguyenGoogle review · Oct 2026We {Carrie & Ted S.} are very pleased that we chose Mike Tamou Law Group to represent a criminal case that was against our granddaughter. The case against her was for two different ordeals, and in both situations - the cases were handled above & beyond what we expected. Because of Mike's quickness and professionalism, both situations were resolved in an expedited manor with positive results that we were extremely pleased with. Our granddaughter is also extremely pleased with the results. We would recommend {Mike} Tamou Law Group to anybody that is seeking legal advice in a criminal situation.
TSTed SchroederGoogle review · Jul 2026I had an aggravated DUI case class 4 felony. With an extensive criminal record of 7 prior felonies. Mr. Tamou did an outstanding job on my case, he got me the least possible amount of time. He got the prosecutor not to allege any of my priers. I did just 4 months with a probation tail. Other lawyers I spoke with prior to retaining M. Tamou, told me the best they could get, would be a few years in prison, due to my extensive criminal history. Michael said he would fight for me and he delivered. He has relationships with the prosecutors and judges and is a great negotiator. Also he was great with communicating with me throughout the process. Always returned my calls and text messages and kept me informed. I highly recommend him.
PGPaul GonzalezGoogle review · May 2026I had a great experience with Tamou Law! Michael was very helpful. He took the time to explain everything in a way that was easy for me to understand, which made the entire process feel much less overwhelming. He was patient, professional, and always made sure I felt informed and comfortable with each step. I truly appreciated his communication and support throughout! HIGHLY RECOMMEND!
SSandraGoogle review · Apr 2026Michael is truly amazing. I am so happy that I chose him to help me with my legal situation. He is completely trustworthy. Michael was completely transparent and honest throughout the entire process and offered support to me like I was his own family member. He was patient and understanding and prompt in responding to any of my inquiries during my waiting period. His explanations were clear and logical, and I felt beyond comfortable with him. I really appreciate him and the staff in his practice, and I highly recommend him for anyone's legal needs!! Thank you, Michael! You're really the best. I appreciate you!
RLRochelle LeeGoogle review · Feb 2026Our family went through the worst time of our lives! It was wonderful to have Michael on our side fighting for us and giving us the advice we needed to take the right steps. Case Dismissed! Thank you for your hard work, dedication, and support.
RERussell EllisGoogle review · Aug 2026He's the Greatest lawyer we could have ever asked for he put his heart into helping us and we came out with exactly what we wanted! I highly recommend him!
JOJose OrtizGoogle review · Oct 2026⭐️⭐️⭐️⭐️⭐️ I cannot thank Mike Tamou enough for what he did for my family. My son was facing serious charges that could have changed the course of his life forever. From the very beginning, Mr. Tamou treated us with compassion, respect, and honesty. He took the time to explain every step of the process, always making sure we understood what was happening and what to expect. His professionalism and dedication were unmatched. He worked tirelessly on my son’s case, exploring every possible option and fighting for the best outcome. Because of Mike’s skill, expertise, and determination, my son was saved from going to jail and now has the opportunity to move forward and rebuild his life. I am forever grateful for his hard work and would highly recommend Mike Tamou to anyone in need of a strong, knowledgeable, and caring defense attorney. He doesn’t just represent his clients—he truly fight for them.
EHErin HernandezGoogle review · 2025Michael did an amazing job helping my loved one with his case. He was the first call I made and I knew right then how much he truly cared for his clients. I highly recommend Tamou Law to anyone who reads this review. Michael worked extremely hard for us and exceeded my expectations of the outcome. He is compassionate, very knowledgeable, experienced, respected and very fair. He always took the time to take my calls and to listen to questions that we had. He works hard for his clients and is the kind of guy you want on your side. Thanks again Michael. You were a pleasure to work with.
LBLaurie BryantGoogle review · 2024Great experience from start to finish. Professional, responsive, and made a stressful situation much easier. I felt confident the whole time and really appreciated Michael’s support. Highly recommend!
SMShivraj MannGoogle review · Apr 2026Had a situation that Michael helped me through with the best possible outcome. Very responsive and actually cares about his clients.
CJCaleb JohnsonGoogle review · Aug 2026My son was an idiot and was in serious trouble. He was facing prison time. Fortunately, we were referred to Tamou Law Group by trusted friends and we are beyond grateful that we listened. From the onset, Michael helped to put our family at ease. We discussed the charges where Mike provided insight that helped adjust our expectations. Sure enough, it played out nearly exactly like Mike predicted. Mike put a strong case together – which resulted with no jail time! If you find yourself in need of legal representation, you should hire Michael Timou!
AHArmando HernandezGoogle review · 2025I can’t recommend Tamou law group enough. From day one, Micheal took the time to really listen, explained my options in a way that actually made sense, and built a strong strategy that put my mind at ease. The entire team was professional, responsive and genuinely caring throughout the whole process. They fought tirelessly and delivered a result that far exceeded my expectations. If you need a law firm you can trust completely, this is it. Thank you!
BKBryan KingGoogle review · Dec 2025
Why Tamou Law Group for Criminal Defense
Every criminal case in Arizona is decided by what the State can prove, and the State proves less when the defense starts early. We get into cases before charges are filed whenever we can, and we build them on evidence rather than argument.
Results across the spectrum
Our published results include armed robbery and sexual assault cases dismissed, reckless driving dismissed, diversion on drug and theft charges, probation with no jail on aggravated DUI, and a second-degree murder charge reduced. Every case is different, and these show how we fight.
Former prosecutors and law enforcement officers
Our team includes former prosecutors and law enforcement officers, so we know how the State builds a case and where it breaks down. Michael Tamou handled roughly 500 cases a year at the public defender’s office before founding the firm.
Recognized, and available
Michael Tamou is recognized by the National Trial Lawyers Top 100 and Top 40 Under 40, Super Lawyers Southwest and Elite Lawyer 2026. We answer 24/7 from our Phoenix and Scottsdale offices, and we appear in Maricopa, Pima and Pinal County courts.
Published results in this area
| Case | Charges | Outcome |
|---|---|---|
| State v. D.O. | Armed robbery and aggravated assault (A.R.S. 13-1904, 13-1204) | Dismissed |
| State v. W.N. | Sexual assault and sexual abuse (13-1406, 13-1404) | Case dismissed |
| State v. C.K. | Reckless driving and racing (28-693, 28-708) | Case dismissed |
| State v. N.K. | Possession of narcotic drugs (13-3408, 13-3415) | Diversion |
| State v. L.S. | Aggravated DUI (28-1383) | Probation, no jail |
| State v. F.N. | Second-degree murder (13-1104) | Reduced charge |
Anonymized outcomes from our case results page. Every case is different; past results do not guarantee a future outcome.
Frequently Asked Questions
Can I be charged with hindering prosecution for helping a family member?
Yes. Arizona’s hindering prosecution statutes do not carve out an exception for family. If you knowingly harbored, warned, or concealed a relative who was wanted, you can be charged. However, the state still has to prove you acted with the specific intent to hinder their apprehension, which is often harder to establish than the relationship itself.
What if I did not know the person had committed a crime?
Lack of knowledge is one of the strongest defenses. Under A.R.S. 13-2510, you must have knowingly rendered assistance. If you genuinely did not know the person was wanted or accused, or did not know what you handled was evidence, a required element is missing and the charge should not stand.
Is hindering prosecution a felony in Arizona?
It depends on the underlying offense. If the person you helped was wanted for a felony, hindering in the first degree under A.R.S. 13-2512 is a class 5 felony, or a class 3 felony if murder, terrorism, or a criminal street gang is involved. If they were wanted for a misdemeanor, it is a class 1 misdemeanor under A.R.S. 13-2511.
How is hindering prosecution different from being an accomplice?
An accomplice under A.R.S. 13-301 helps commit the crime itself and is treated as if they committed it. Hindering prosecution punishes helping someone avoid arrest or punishment after the fact. Hindering generally carries less exposure than accomplice liability for the underlying felony, which is why the way a case is charged matters so much.
Can I be convicted if the other person is found not guilty?
Potentially, yes. The hindering statute focuses on the offense the person was accused of and your intent to help them evade the law, not on the final outcome of their case. That said, a weak or dismissed underlying case can undercut the felony classification and give your defense significant leverage.
Does lying to police about where someone is count as hindering?
It can. Knowingly concealing a wanted person’s presence or identity to prevent their arrest may qualify as rendering assistance under A.R.S. 13-2510. But refusing to answer, honestly not knowing where they were, or an innocent mistake is different from a knowing lie made with intent to hinder, and that distinction is often where these cases are won.
What does “renders assistance” mean under Arizona law?
A.R.S. 13-2510 defines it as knowingly harboring or concealing the person, warning them of impending arrest, providing money, transportation, a weapon, or a disguise, obstructing someone who might help catch them, suppressing physical evidence, or concealing their identity. If your conduct does not fit one of those categories, it is not hindering prosecution.
Is throwing away or hiding evidence hindering prosecution?
It can be, if you knowingly concealed, altered, or destroyed physical evidence to help someone avoid discovery or conviction. The key word is knowingly. If you did not know the item was evidence of a crime, you did not knowingly suppress it, and that lack of knowledge can defeat this form of the charge.
What are the realistic outcomes for a first-time hindering charge?
First-time cases often have room to negotiate, especially when intent and knowledge are hard to prove. A class 5 felony can sometimes be reduced to a misdemeanor, resolved through a program for eligible first offenders, or weakened when the underlying offense falls apart. Outcomes depend heavily on the facts and your criminal history.
Should I talk to police if they are asking about someone else?
Be very careful. Officers asking about another person’s whereabouts may be building a hindering case against you without saying so. You have the right to remain silent and to have a lawyer present. It is usually wise to speak with an attorney before answering questions that could turn you from a witness into a defendant.
Two Arizona Offices, One Team
We serve all of Maricopa County and the surrounding area, with free, confidential consultations 24/7 by phone and in-person meetings at either office by appointment.
Case Results Disclaimer: The results described on this page are based on specific facts and circumstances and do not guarantee or predict a similar outcome in any future case. Every case is different. Past results do not guarantee future results. No attorney-client relationship is formed by viewing this page or submitting a contact form until a written fee agreement has been signed. Tamou Law Group, PLLC is licensed to practice law in the State of Arizona. This website is for informational purposes only and does not constitute legal advice.
(function() {
function customizeConsultForm() {
var form = document.querySelector('#consult-form');
if (!form) return false;
var fields = form.querySelectorAll('.gfield');
var emailField = null;
var didWork = false;
fields.forEach(function(field) {
var label = field.querySelector('.gfield_label, label');
if (!label) return;
var labelText = (label.textContent || '').trim().toLowerCase();
if (labelText.indexOf('best way to reply') !== -1 || labelText.indexOf('preferred contact') !== -1) {
field.classList.add('tlg-hide-field');
field.querySelectorAll('input').forEach(function(input) {
input.checked = false;
input.removeAttribute('required');
});
didWork = true;
}
if (labelText.indexOf('email') !== -1) {
emailField = field;
field.classList.add('tlg-email-required');
field.querySelectorAll('input[type="email"], input[type="text"]').forEach(function(input) {
input.setAttribute('required', 'required');
input.setAttribute('aria-required', 'true');
});
didWork = true;
}
});
var gform = form.tagName === 'FORM' ? form : (form.querySelector('form') || form.closest('form'));
if (!gform) gform = document.querySelector('#consult-form form, form[id^="gform_"]');
if (gform && !gform.dataset.tlgSourceBound) {
gform.dataset.tlgSourceBound = '1';
var pageUrl = window.location.href;
var pageTitle = document.title || 'Phoenix White Collar Defense Lawyers';
var pagePath = window.location.pathname;
var sourceTag = '[Source: ' + pageTitle.replace(/\s*[,|].*$/, '') + ' | ' + pagePath + ']';
['source_page', 'page_url', 'lander_url'].forEach(function(name) {
var h = document.createElement('input');
h.type = 'hidden';
h.name = name;
h.value = pageUrl;
gform.appendChild(h);
});
var hp = document.createElement('input');
hp.type = 'hidden';
hp.name = 'source_path';
hp.value = pagePath;
gform.appendChild(hp);
function findMessageField() {
var match = null;
form.querySelectorAll('.gfield').forEach(function(field) {
var label = field.querySelector('.gfield_label, label');
if (!label) return;
var t = (label.textContent || '').trim().toLowerCase();
if (t.indexOf('message') !== -1 || t.indexOf('comment') !== -1 || t.indexOf('detail') !== -1 || t.indexOf('describe') !== -1 || t.indexOf('tell us') !== -1 || t.indexOf('your story') !== -1) {
match = field.querySelector('textarea, input[type="text"]');
}
});
if (!match) match = form.querySelector('textarea');
return match;
}
function prependSource() {
var textarea = findMessageField();
if (textarea && textarea.value.indexOf('[Source:') === -1) {
textarea.value = sourceTag + '\n\n' + (textarea.value || '');
}
}
gform.addEventListener('submit', prependSource, true);
var submitBtns = gform.querySelectorAll('input[type="submit"], button[type="submit"], .gform_button');
submitBtns.forEach(function(btn) {
btn.addEventListener('click', function() {
setTimeout(prependSource, 0);
prependSource();
}, true);
});
}
var submitBtn = form.querySelector('input[type="submit"], button[type="submit"]');
if (submitBtn && emailField && !submitBtn.dataset.tlgBound) {
submitBtn.dataset.tlgBound = '1';
submitBtn.addEventListener('click', function(e) {
var emailInput = emailField.querySelector('input[type="email"], input[type="text"]');
if (emailInput && !emailInput.value.trim()) {
e.preventDefault();
emailInput.focus();
emailInput.style.borderColor = '#c62828';
emailInput.style.boxShadow = '0 0 0 3px rgba(198,40,40,.15)';
}
});
}
return didWork;
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', customizeConsultForm);
} else {
customizeConsultForm();
}
var attempts = 0;
var interval = setInterval(function() {
attempts++;
var done = customizeConsultForm();
if (done || attempts > 10) clearInterval(interval);
}, 500);
})();







