As Seen On

Recognized By
Featured Answer
Can a Drug Charge Be Dismissed in Arizona?
Yes, a drug charge can be dismissed in Arizona. Common paths are Fourth Amendment suppression of an illegal search, a TASC or county deferred-prosecution diversion program that drops the charge on completion, and constructive-possession or crime-lab gaps that stop the state from proving the drugs were knowingly yours.

Being booked on a drug charge in Maricopa County feels final, but a drug case is one of the most dismissible felonies in Arizona. These prosecutions depend on a chain of things going right for the state: a lawful stop, a lawful search, drugs that can be tied to a specific person, and a crime lab that can prove what the substance actually was and how much of it there was. Break any link and the case can be suppressed, reduced, or dismissed.
This guide walks through the specific mechanisms that get Arizona drug charges dismissed, reduced, or diverted, and how each one actually plays out in court. For the underlying penalty ranges and charge levels, see our Phoenix drug crimes lawyer page; this article focuses on getting out of the charge, not just understanding it.
Yes, and it happens more often than most people expect. A drug charge can be dismissed in Arizona at several points: before charges are formally filed, on a pretrial suppression motion, through a diversion program that ends in dismissal, or when the state realizes at trial it cannot prove the substance, the weight, or who possessed it. The best outcome depends entirely on the facts of your stop, your search, and the evidence.
Broadly, there are two families of dismissal. The first is diversion, where you are eligible for a program that trades treatment and clean tests for a dropped charge. The second is a proof failure, where a constitutional, evidentiary, or factual problem stops the state from proving an element beyond a reasonable doubt. The sections below cover both, starting with the diversion route that helps the most first-time defendants.
How Does TASC and Prop 200 Diversion Get a Charge Dropped?
For personal-possession cases, Arizona law leans toward treatment over incarceration. Under ARS 13-901.01, the Proposition 200 statute, a person convicted of personal possession or use of a controlled substance or drug paraphernalia is eligible for probation, and the court must suspend the sentence and place that person on probation with a required drug-treatment or education program. On a first or second personal-possession offense, that means prison is off the table for the possession itself.
Prop 200 sets the sentencing floor, but the dismissal usually comes from a related layer: county deferred-prosecution and TASC drug-diversion programs. In Maricopa County, an eligible first-time possession defendant can be routed into a program of treatment, drug testing, and fees, and the prosecutor dismisses the charge once the program is completed. That is a true dismissal, not a conviction, which is why diversion is the single most common way personal-possession cases end without a record of guilt.
The eligibility limits in ARS 13-901.01 are strict, and reading them matters. The mandatory-probation protection does not apply if you:
- Have been convicted three times of personal possession of a controlled substance or drug paraphernalia;
- Refused drug treatment as a term of probation, or rejected probation;
- Were convicted of personal possession where the offense involved methamphetamine; or
- Have been convicted of or indicted for a violent crime.
Prop 200 also expressly excludes possession for sale, production, manufacturing, and transportation for sale. In other words, diversion is built for users, not for anything the state can frame as dealing. That is why the line between simple possession and possession for sale in Arizona is so heavily litigated: staying on the possession side of that line often decides whether diversion is even available. For a deeper look at the program mechanics, see our page on Prop 200 and TASC diversion in Phoenix.
Can an Illegal Search Get the Drugs Thrown Out?
Yes, and this is the most powerful dismissal tool in a drug case. The Fourth Amendment forbids unreasonable searches and seizures, and Arizona courts enforce it with the exclusionary rule: if police obtained the drugs through an unlawful stop, search, or seizure, the judge can suppress that evidence. In a possession case, the drugs are the case. Suppress them and the state almost always has nothing left, so the charge is dismissed.
The recurring pressure points defense attorneys attack in Arizona drug cases include:
- The stop. A traffic stop needs reasonable suspicion of a violation. A pretextual or hunch-based stop with no valid basis taints everything that follows.
- The search of a car. Officers cannot search your vehicle just because they smell something or want to look; they need a warrant, valid consent, or a recognized exception. Our guide on whether police can search your car without a warrant in Arizona breaks down the exceptions.
- Consent. Consent must be voluntary. Coerced or ambiguous consent, or a search that exceeds the scope of what was agreed to, is challengeable.
- The warrant. A search warrant supported by a stale, thin, or misleading affidavit can be invalidated, taking the seized drugs with it.
A suppression motion is litigated pretrial, often after an evidentiary hearing where the officer testifies. When it succeeds on the core evidence, dismissal frequently follows within days.
What If the Drugs Were in a Shared Car or Home?
Being near drugs is not the same as possessing them. Arizona has to prove you knowingly possessed the substance, and it can try to do that through “constructive possession” — the theory that you knew about the drugs and had control over them even though they were not physically on you. That theory is often the weakest part of the state’s case.
When contraband is found in a car with multiple occupants, in a shared apartment, or in a common area, the state has to connect it to you specifically rather than to a roommate, a passenger, or whoever had access before you. Reasonable doubt about whose drugs they were, and whether you even knew they were there, is exactly what a constructive-possession defense in Phoenix is built to create. In shared-space cases, that doubt can defeat the charge outright or force a reduction.
Can Crime-Lab and Chain-of-Custody Failures End a Case?
They can, and they are underused. To convict, the state must prove the seized material actually was an illegal drug, and often prove its weight, through admissible forensic testing. Every one of those steps can fail.
- Chain of custody. The evidence must be tracked from seizure to testing without gaps or tampering. A missing signature, an unexplained handoff, or a storage error can make the sample unreliable. See our overview of chain of custody in Arizona criminal cases.
- Lab reliability. An uncalibrated instrument, a contaminated batch, a flawed testing protocol, or a backlogged lab can all undermine the result.
- The analyst. The defense has the right to confront the analyst who did the testing. If that analyst is unavailable, has left the lab, or cannot defend the methodology, the report can be excluded.
Without an admissible result confirming both the identity and the quantity of the substance, prosecutors frequently cannot prove the charge as filed, which opens the door to reduction or dismissal.
Can a Case Built on a Confidential Informant Be Beaten?
Yes, because informant cases carry built-in credibility problems. Many drug prosecutions, especially sale and transport cases, rest on a confidential informant who arranged or witnessed a buy. That informant is frequently working off their own charges, being paid, or otherwise motivated to deliver a target, and those motives are fair game.
When the defense exposes an informant’s deal for leniency, a history of dishonesty, or a “controlled buy” with no independent corroboration, the reliability of the entire case erodes. Prosecutors sometimes dismiss rather than burn an informant by putting them on the stand, and judges can suppress evidence that flowed from an unreliable tip. The credibility fight is often where informant-driven cases are won.
What About Insufficient Quantity or Threshold Disputes?
How much was involved changes everything. Arizona uses statutory “threshold amounts” that separate ordinary possession from the far more serious possession-for-sale tiers and control whether probation is even available. Fighting the quantity can move a case down several rungs.
Under the drug statutes, weight drives the charge. Marijuana offenses under ARS 13-3405 are graded by pounds, and for narcotic and dangerous drugs an amount at or above the statutory threshold strips probation eligibility on sale-level charges under ARS 13-3408 and ARS 13-3407. So the fights that matter are whether the state can prove the weight, whether unusable residue counts, and whether the amount really crosses the threshold. Our page on Arizona drug threshold amounts explains why those numbers decide so much. When a mere residue cannot be reliably weighed or identified, that alone can support dismissal.
Is a Medical-Marijuana Card a Valid Defense?
For marijuana charges, it can be a complete one. ARS 13-3405 criminalizes marijuana “except as provided in” Arizona’s medical and adult-use marijuana laws. A valid medical-marijuana registry card that covers the amount involved is an affirmative defense that can lead to dismissal of a simple marijuana possession charge.
The limits matter, though: the protection extends only to lawful amounts and lawful conduct, not to sale-level quantities, and it does not apply to other controlled substances. Where a card and a lawful amount line up, however, presenting that defense early can end a marijuana case before it ever reaches trial.
What Are the Possible Outcomes of an Arizona Drug Case?
Not every case ends in a clean dismissal, but “guilty as charged” is only one of several outcomes, and often the least likely for a first offense. Here is the realistic range, from best to worst, for a personal-possession case handled well.
Possible Outcomes
Personal-possession case under A.R.S. 13-901.01 · 13-3407 · 13-3408
Grounds for Dismissing a Drug Charge, in Short
If you take one thing from this article, make it this checklist. These are the specific grounds a defense lawyer looks for when deciding how a drug charge can be dismissed or beaten in Arizona:
- Unlawful stop, search, or seizure. A Fourth Amendment violation lets the judge suppress the drugs, and suppressing the drugs usually ends the case.
- Diversion eligibility. A first or second personal-possession offense can go through a TASC or county deferred-prosecution program and be dismissed on completion.
- Constructive-possession gaps. Drugs in a shared car or home that the state cannot tie to you specifically create reasonable doubt on the knowing-possession element.
- Crime-lab and chain-of-custody failures. No admissible proof of the substance’s identity or weight means no provable case.
- Confidential-informant credibility. An informant working off charges or being paid can be impeached, and uncorroborated tips can be suppressed.
- Threshold and quantity disputes. Unusable residue or a weight below the charged threshold can force a reduction or dismissal.
- Valid medical-marijuana defense. A registry card covering a lawful amount is an affirmative defense to a marijuana possession charge.
How Tamou Law Group Defends Drug Cases
Drug prosecutions in Maricopa County move quickly, and the early decisions shape everything: whether diversion stays available, whether the stop gets challenged, and whether you say something at the scene that boxes you in. Our first steps are getting the police report and body-camera footage, scrutinizing the stop and search for suppression issues, and confirming whether you qualify for TASC or deferred prosecution before any plea is discussed.
From there the case is fought on the elements: whether the search was lawful, whether the drugs can be tied to you, whether the lab can prove what the substance was and how much, and whether the charged threshold actually holds. Our team of former prosecutors, law enforcement officers, and public defenders handles the full range of Phoenix drug charges. Call 623-321-4699 to talk through the specific facts of your stop and search.
Related Arizona Drug Charge Guides
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, public defenders, and law enforcement.
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 Drug Charges
Most Arizona drug cases begin with a stop and a search, and they are won or lost on whether that search was lawful and whether the lab can prove what was found. We litigate both before we ever talk about a plea.
Diversion and dismissal-track outcomes
Our published results include diversion on narcotic, dangerous-drug and marijuana possession cases, and reduced charges on transportation-for-sale allegations. Where the stop or the lab is weak, we push for an outcome that leaves no conviction.
We know how drug cases are built
Former prosecutors and law enforcement officers on our team have built drug cases for the State. They know the search-and-seizure sequence a stop must follow, the chain-of-custody records a lab must keep, and what happens when either one is missing.
Possession versus sale
The line between possession and possession for sale is the line between probation and real prison exposure, and at or above the statutory threshold amount a for-sale conviction makes prison mandatory. We attack the inference of sale, from text messages to packaging to the weight thresholds, because that is where years of exposure sit.
Published results in this area
| Case | Charges | Outcome |
|---|---|---|
| State v. N.K. | Possession of narcotic drugs and paraphernalia (A.R.S. 13-3408, 13-3415) | Diversion |
| State v. E.T. | Possession of dangerous drugs, paraphernalia and resisting arrest (13-3407, 13-3415) | Diversion |
| State v. Y.T. | Possession of marijuana, paraphernalia and dangerous drugs (13-3405, 13-3415) | Diversion |
| State v. Z.J. | Transportation of dangerous drugs for sale (13-3407) | Reduced charge |
| State v. A.N. | Transportation and possession of narcotic drugs for sale (13-3408) | 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 a first-time drug possession charge be dismissed in Arizona?
Often it can be resolved without a conviction. Under ARS 13-901.01, a first personal-possession offense is mandatory-probation eligible, and many counties add TASC diversion that dismisses the charge entirely once you finish treatment. Suppression of an illegal search can also end the case outright before any plea.
What is the fastest way to get a drug charge dropped?
The fastest dismissals come from a successful suppression motion. If police stopped, searched, or seized the drugs unlawfully, the judge can exclude that evidence under the Fourth Amendment, and without the drugs the state usually has no case and dismisses it. Diversion completion is the other common path to dismissal.
Does completing TASC or diversion dismiss the charge?
Yes. In Maricopa County and most Arizona counties, deferred-prosecution and TASC drug-diversion programs are built so that finishing the required treatment, testing, and fees leads the prosecutor to dismiss the charge. The arrest may still show, but you avoid a conviction and can pursue sealing later.
Can drugs found in a shared car or house be dismissed?
Frequently, yes. The state must prove you knowingly possessed the drugs, not just that you were nearby. When contraband is found in a shared car or home and not on your person, a constructive-possession defense argues the state cannot tie the drugs to you specifically, which can defeat or reduce the charge.
Can a crime-lab error get a drug case thrown out?
It can. The state must prove the substance actually was an illegal drug through valid lab testing. Broken chain of custody, contamination, an uncalibrated instrument, or an analyst who cannot testify can make the results inadmissible. Without a confirmed identity and weight, prosecutors often cannot prove their case.
Is a medical-marijuana card a defense to a drug charge?
It can be. Arizona’s marijuana statutes in ARS 13-3405 apply except as provided in the medical and adult-use exceptions. A valid registry card protecting a lawful amount is an affirmative defense that can lead to dismissal of a marijuana possession charge, though it does not cover sale-level quantities or other drugs.
What if the amount of drugs was very small?
Quantity matters. Threshold amounts under Arizona law separate simple possession from possession for sale and control probation eligibility. A tiny or unmeasurable amount, or a weight below the charged threshold, can knock a case down to a lesser charge or, when the residue cannot be reliably identified, support dismissal.
Can a drug charge based on a confidential informant be dismissed?
Sometimes. Cases built on a confidential informant rise or fall on that informant’s credibility, motive, and reliability. When the defense exposes a deal for leniency, a paid tip, or an uncorroborated buy, the judge may suppress the evidence or the state may dismiss rather than expose the informant at trial.
Will a dismissed drug charge stay on my record?
The charge is dropped, but the arrest record can remain until you act. Arizona now allows many drug offenses to be sealed under the record-sealing law, and a case that ends in dismissal or diversion is far easier to clear than a conviction. A defense lawyer can walk you through eligibility.
Do I need a lawyer to get a drug charge dismissed?
Dismissal almost never happens on its own. Suppression motions, threshold and lab challenges, constructive-possession arguments, and diversion negotiations all require a defense attorney who knows how Maricopa County prosecutors handle drug cases. The earlier counsel reviews the stop and search, the more paths to dismissal stay open.
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);
})();







