--- loncom/interface/loncommon.pm 2005/09/14 20:42:36 1.272 +++ loncom/interface/loncommon.pm 2005/09/14 21:25:52 1.273 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.272 2005/09/14 20:42:36 raeburn Exp $ +# $Id: loncommon.pm,v 1.273 2005/09/14 21:25:52 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -419,6 +419,31 @@ sub selectcourse_link { '","'.$udomele.'","'.$desc.'","'.$extra_element.'");'."'>".&mt('Select Course').""; } +sub check_uncheck_jscript { + my $jscript = <<"ENDSCRT"; +function checkAll(field) { + if (field.length > 0) { + for (i = 0; i < field.length; i++) { + field[i].checked = true ; + } + } else { + field.checked = true + } +} + +function uncheckAll(field) { + if (field.length > 0) { + for (i = 0; i < field.length; i++) { + field[i].checked = false ; + } } else { + field.checked = false ; + } +} +ENDSCRT + return $jscript; +} + + =pod =item * linked_select_forms(...)