it's quite possible that you are referencing your form incorrectly. If you are just working with named fields (ie, no id's), easiest is to name your form.
you will also want to remove the dot between the form reference and the first square bracket, and also bear in mind that you are starting your loop off at 0 but your field names start at 1:
<input type="text" name="dirLen1"/>
<input type="text" name="dirLen2"/>
<input type="text" name="dirLen3"/>