HELP! * GREY=local LOCAL HTML version of Foils prepared 15 January 1997

Foil 80 Create RadioButtons Dynamically

From JavaScript Tutorial for CPS616 Technologies of the Information Age 1997 Basic Information Track of CPS -- Spring Semester 97. by Geoffrey C. Fox * See also color IMAGE

function flexbuttons(maxradio, groupname, number, indname, indexselected, onprocess) {
if( number <= maxradio) {
for( var i=1; i <= number ; i++) {
  • top.fred.document.writeln('<input type="radio" name="' + groupname + '" value="' + indname[i] + '"');
  • if( i == indexselected )
  • top.fred.document.writeln('CHECKED');
  • top.fred.document.writeln(' onClick="' + onprocess + '(this,this,' + i + ')" >');
} // end for loop
} // end radio button if statement



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 Sat May 24 1997