Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] array elements question


  • From: javascript@xxxxxxxxxx (Rochester, Dean)
  • Subject: [Javascript] array elements question
  • Date: Wed, 20 Mar 2002 10:03:31 -0500

I have a form that has tabs, so it is actually 5 forms in one.  I want to
check the values of the form elements of the current form before the
contents of the next tab are presented.  I have tried making an array of
elements of the current forms elements, but it did not like that

if(lelemClass == "demo"){
        var lelements = new Array();
        lelements[0] = "Patient_First_Name";
        lelements[1] = "Patient_Last_Name";
        lelements[2] = "Sex";
        lelements[3] = "Patient_DOB";
        lelements[4] = "SSN";
        lelements[5] = "Local_Area_Code";
        lelements[6] = "Local_Number";
        lelements[7] = "Work_Area_Code";
        lelements[8] = "Work_Number";
    }
   
    if(lelemClass == "nok"){
        var lelements = new Array();
        lelements[0] = "PrimaryNOK_Area_Code";
        lelements[1] = "PrimaryNOK_Local_Number";
        lelements[2] = "Emergency_First_Name";
        lelements[3] = "Emergency_Area_Code";
        lelements[4] = "Emergency_Local_Number";
    }

......

did not like the next line...
strEdit = document.mainform.lelements[intLoop].getAttribute('edit'); 

how can I do this?

Thanks in advance
Dean-O