Dictionary printed missing elements

I have a dictionary that is filled with string from text boxes. When I try printing the dictionary only has 11 elements, but I assigned 13.

here is the code.

stringHarvestYear = event.source.parent.getComponent('textfieldHarvest').text
stringLotNumber = event.source.parent.getComponent('textfieldLotNum').text
stringAlphaAcids = event.source.parent.getComponent('textfieldAlphaAcid').text
stringAlphaRe = event.source.parent.getComponent('textfieldAlphaRe').text
stringGrowerNum = event.source.parent.getComponent('textfieldGrowerNum').text
stringActive = event.source.parent.getComponent('textfieldActive').text
stringPurchased = event.source.parent.getComponent('textfieldPurchased').text
stringTotBales = event.source.parent.getComponent('textfieldTotBales').text
stringOffSite = event.source.parent.getComponent('textfieldOffsite').text
stringOffBales = event.source.parent.getComponent('textfieldOffBales').text
stringOnSite = event.source.parent.getComponent('textfieldOnSite').text
stringOnBales = event.source.parent.getComponent('textfieldOnBales').text
stringBaleWt = event.source.parent.getComponent('textfieldBaleWt').text

stringList = {stringPurchased:"amtpurchased",stringTotBales:"amtbalespurchased",stringHarvestYear:"harvestyear",stringLotNumber:"lotnumber",stringAlphaAcids:"alphaacid",stringGrowerNum:"growernumber",stringAlphaRe:"alpharecheck",stringActive:"active",stringOffSite:"invoffsite",stringOffBales:"balesoffsite",stringOnSite:"invonsite",stringOnBales:"balesonsite",stringBaleWt:"AvgBaleWt"}

print stringList

The console window receives this after clicking the button

I think you have your keys and values mixed up. It goes {KEY:VALUE}, so you’re using your text box value as the key. I would guess that 3 of your boxes have the same values, so the keys collide, and you end up with only 1 represented. Switch your statements to be like “amtpurchased”:stringPurchased and you should be good to go.

Regards,