LyndonOHRC
Programmer
I'm wanting to pass a dynamic set of values to a function from the option elements of a form. I'm am having trouble with my first idea, but if there's a better approach I'm surely open to other ideas.
The original select options will be populated dynamically from a user maintained database. My idea was to structure the value of each option something like this:
This would result in a form with 3 input elements with element 3 not being needed.
I tried the following just to get the properties into an array and display them before moving on to constructing my dynamic form:
This resulted in array[0] containing the complete string and, of course, the rest of them are undefined.
1. Is this a good concept to proceed with?
2. If so, how do I populate the array using the string I've described?
Thank you in advance!
Lyndon
---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
The original select options will be populated dynamically from a user maintained database. My idea was to structure the value of each option something like this:
Code:
<option value='"amount","region","","employer"'>Jones Inc.</option>
This would result in a form with 3 input elements with element 3 not being needed.
I tried the following just to get the properties into an array and display them before moving on to constructing my dynamic form:
Code:
function ItemSelectedHandler(){
var e = document.getElementById(selectedGroup);
var strLicenseType = e.options[e.selectedIndex].value;
if (strLicenseType){
var propertyArray=new Array(strLicenseType);
document.getElementById("itemDataEntryRow").innerHTML=propertyArray[0]+' '+propertyArray[1]]+' '+propertyArray[2]]+' '+propertyArray[3];
}else{
document.getElementById("itemDataEntryRow").innerHTML='No Selection';
}
}
This resulted in array[0] containing the complete string and, of course, the rest of them are undefined.
1. Is this a good concept to proceed with?
2. If so, how do I populate the array using the string I've described?
Thank you in advance!
Lyndon
---People Remember about 10% of what you say ---They never forget how you made them feel. Covey