We present a model for the decay $D^+to K^-pi^+pi^+$. The weak interaction part of this reaction is described using the effective weak Hamiltonian in the factorisation approach. Hadronic final state interactions are taken into account through the $Kpi$ scalar and vector form factors fulfilling analyticity, unitarity and chiral symmetry constraints. Allowing for a global phase difference between the $S$ and $P$ waves of $-65^circ$, the Dalitz plot of the $D^+to K^-pi^+pi^+$ decay, the $Kpi$ invariant mass spectra and the total branching ratio due to $S$-wave interactions are well reproduced.