--- loncom/interface/loncommon.pm 2009/07/27 22:35:12 1.871 +++ loncom/interface/loncommon.pm 2009/07/31 02:13:05 1.872 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.871 2009/07/27 22:35:12 raeburn Exp $ +# $Id: loncommon.pm,v 1.872 2009/07/31 02:13:05 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -529,6 +529,11 @@ sub coursebrowser_javascript { } } } + if (formname == 'ccrs') { + var ownername = document.forms[formid].ccuname.value; + var ownerdom = document.forms[formid].ccdomain.options[document.forms[formid].ccdomain.selectedIndex].value; + url += '&cloner='+ownername+':'+ownerdom; + } if (multflag !=null && multflag != '') { url += '&multiple='+multflag; } @@ -1802,16 +1807,15 @@ selected"); If the $showdomdesc flag is set, the domain name is followed by the domain description. -If the $autosubmit flag is set, the form containing the domain selector will be auto-submitted by an onchange action. +The optional $onchange argumnet specifies what should occur if the domain selector is changed, e.g., 'this.form.submit()' if the form is to be automatically submitted. =cut #------------------------------------------- sub select_dom_form { - my ($defdom,$name,$includeempty,$showdomdesc,$autosubmit) = @_; - my $onchange; - if ($autosubmit) { - $onchange = ' onchange="this.form.submit()"'; + my ($defdom,$name,$includeempty,$showdomdesc,$onchange) = @_; + if ($onchange) { + ' onchange="'.$onchange.'"; } my @domains = sort {lc($a) cmp lc($b)} (&Apache::lonnet::all_domains()); if ($includeempty) { @domains=('',@domains); }