D
Dave Anderson
I am attempting to create a 2 part selection box.
I am filling in the second data with the following array, generated by .asp
arrayData[0] = 'Process Standards for Professional
Development|Data-Driven|252'
arrayData[1] = 'Process Standards for Professional
Development|Evaluation|253'
arrayData[2] = 'Process Standards for Professional
Development|Research-Based|254'
arrayData[3] = 'Process Standards for Professional Development|Design|255'
arrayData[4] = 'Process Standards for Professional
Development|Learning|256'
arrayData[5] = 'Process Standards for Professional
Development|Collaboration|257'
arrayData[6] = 'Content Standards|Equity|258'
arrayData[7] = 'Content Standards|Quality Teaching|259'
arrayData[8] = 'Content Standards|Family Involvement|260'
I am spitting the data with | to display in the second selection. This
works. However, how do I grab the third string? This is the value for my
select list.
function populateData( name, value ) {
select = window.document.form.SubTopic;
string = "";
// 0 - will display the new options only
// 1 - will display the first existing option plus the new options
count = 0;
// Clear the old list (above element 0)
select.options.length = count;
for( i = 0; i < arrayData.length; i++ ) {
string = arrayData.split( "|" );
if( string[0] == name ) {
select.options[count++] = new Option( string[1]);
}
My html
<select name="SubTopic" size=3 style="width:300;">
</select>
I am filling in the second data with the following array, generated by .asp
arrayData[0] = 'Process Standards for Professional
Development|Data-Driven|252'
arrayData[1] = 'Process Standards for Professional
Development|Evaluation|253'
arrayData[2] = 'Process Standards for Professional
Development|Research-Based|254'
arrayData[3] = 'Process Standards for Professional Development|Design|255'
arrayData[4] = 'Process Standards for Professional
Development|Learning|256'
arrayData[5] = 'Process Standards for Professional
Development|Collaboration|257'
arrayData[6] = 'Content Standards|Equity|258'
arrayData[7] = 'Content Standards|Quality Teaching|259'
arrayData[8] = 'Content Standards|Family Involvement|260'
I am spitting the data with | to display in the second selection. This
works. However, how do I grab the third string? This is the value for my
select list.
function populateData( name, value ) {
select = window.document.form.SubTopic;
string = "";
// 0 - will display the new options only
// 1 - will display the first existing option plus the new options
count = 0;
// Clear the old list (above element 0)
select.options.length = count;
for( i = 0; i < arrayData.length; i++ ) {
string = arrayData.split( "|" );
if( string[0] == name ) {
select.options[count++] = new Option( string[1]);
}
My html
<select name="SubTopic" size=3 style="width:300;">
</select>