The G14.225-0.506 infrared dark cloud ( IRDC G14.2 ) displays a remarkable complex of parallel dense molecular filaments projected on the plane of the sky . Previous dust emission and molecular-line studies have speculated whether magnetic fields could have played an important role in the formation of such long-shaped structures , which are hosts to numerous young stellar sources . In this work we have conducted a vast polarimetric survey at optical and near-infrared wavelengths in order to study the morphology of magnetic field lines in IRDC G14.2 through the observation of background stars . The orientation of interstellar polarization , which traces magnetic field lines , is perpendicular to most of the filamentary features within the cloud . Additionally , the larger-scale molecular cloud as a whole exhibits an elongated shape also perpendicular to magnetic fields . Estimates of magnetic field strengths indicate values in the range 320 - 550 \mu G , which allows sub-alfvénic conditions , but does not prevent the gravitational collapse of hub-filament structures , which in general are close to the critical state . These characteristics suggest that magnetic fields played the main role in regulating the collapse from large to small scales , leading to the formation of series of parallel elongated structures . The morphology is also consistent with numerical simulations that show how gravitational instabilities develop under strong magnetic fields . Finally , the results corroborate the hypothesis that a strong support from internal magnetic fields might explain why the cloud seems to be contracting on a time scale 2 - 3 times larger than what is expected from a free-fall collapse .