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

Foil 54 Create RadioButtons 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

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 Tue Feb 18 1997