this.getField returns null
The Code shows below:
var proposedInsured = [
'110. Insured Family History Has any of your parents, brothers or sisters, whether living or dead, been diagnosed with breast, colon, ovarian, rectal, or other types of cancer, heart disease, cardiomyopathy, stroke, diabetes, muscular dystrophy, Alzheimer’s di',
'111. Insured Family History Are you currently taking any medication?',
'113. Insured Height and Weight Information Has there been a weight change of more than 10 pounds (4.5 kilos) within the last 12 months?',
'114a. Insured high blood pressure, chest pain/discomfort, heart murmur, rheumatic fever, stroke, aneurysm, circulatory or heart disorder?',
'114b.Insured diabetes, sugar in the urine, thyroid or other glandular (endocrine) disorder?',
'114c. Insured kidney, bladder, or urinary disorder/infection, sexually transmitted disease, reproductive organ or prostate disorder?',
'114d. Insured disorders of the skin or pigmentation, enlarged glands or lymph nodes, nodules, polyps, cysts, lumps, tumor, mass, abnormal growth, cancer, malignancy, or any related conditions?',
'114e. Insured asthma, chronic cough, pneumonia, tuberculosis, emphysema, or any other respiratory or lung disorder?',
'114f. Insured fainting spells, convulsion, developmental delay, epilepsy, seizure, tremor, loss of consciousness, paralysis, severe headache(s) or migraine(s) or any other disorder of the brain or nervous system?',
'114g. Insured anxiety, depression, stress or any emotional/psychological, mental or psychiatric disorder?',
'114h. Insured ulcers, ulcerative colitis, intestinal bleeding, pancreatitis, hepatitis, cirrhosis, Crohn\'s disease or other disorders of the stomach, digestive organ or liver?',
'114i. Insured arthritis or systemic lupus erythematosus, gout, back or spinal disorder, joint pain, multiple sclerosis, bone fracture, muscular weakness or muscle disorder?',
'114j. Insured anemia, bleeding or blood disorder?',
'114k. Insured AIDS or positive HIV test?',
'114l. Insured any other illness or surgery?',
'115. Insured Do you have any health symptoms, recurring or persistent pains, or complaints for which a physician has not been consulted or treatment has not been received?',
'116a. Insured consulted any doctor or other health practitioner?',
'116b. Insured submitted to blood tests, ecg, x-rays, treadmill, echocardiogram, scans, MRI, ultrasounds, mammography, colonoscopy, biopsies or other tests?',
'116c. Insured attended or been admitted to any hospital or other medical facility?'
];
var proposedInsuredCounter = 0;
for (var inputField of proposedInsured) {
var field = this.getField(inputField);
if(field.value == "Y"){
proposedInsuredCounter++;
}
}
var field is null.
is there something wrong with my code that causes field to become null?
i tried showing datas from proposedInsured and i am able to do so. but when i pass data to var field, field becomes null..
