HELP! * GREY=local LOCAL HTML version of Foils prepared 26 February 1996

Foil 55 Create Select Field Dynamically

From CPS616 Lectures on JavaScript CPS616 Basic Information Track for Computational Science -- Winter-Spring Semester 96. by Geoffrey C. Fox * See also color IMAGE

else { // Case whem enough options for a select field
top.fred.document.writeln('<select name="' + groupname + '" onChange="' + onprocess + '(this,this.options[this.selectedIndex],(1+this.selectedIndex))" >');
  • for( var i=1; i <= number ; i++) {
  • var ifselected = ' ';
  • if( i == indexselected )
  • ifselected = ' SELECTED ';
  • top.fred.document.writeln('<option ' + ifselected + 'value="' + indname[i] + '" >' + indname[i]);
  • } // End for loop
top.fred.document.writeln('</select>');
} // End else for generating select field
} // End of flexbuttons



Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Tue Feb 18 1997