--- loncom/homework/structuretags.pm 2015/03/07 23:13:09 1.531 +++ loncom/homework/structuretags.pm 2015/04/10 12:01:28 1.534 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.531 2015/03/07 23:13:09 raeburn Exp $ +# $Id: structuretags.pm,v 1.534 2015/04/10 12:01:28 droeschl Exp $ # # Copyright Michigan State University Board of Trustees # @@ -287,6 +287,17 @@ function setSubmittedPart (part,prefix) } } +function disableAutoComplete (id) { + var field = document.getElementById(id); + if (field != null && field != undefined){ + if ('autocomplete' in field) { + field.autocomplete = "off"; + } else { + field.setAttribute("autocomplete", "off"); + } + } +} + function image_response_click (which, e) { init_geometry(); if (!e) { e = window.event; } //IE @@ -807,7 +818,7 @@ sub template_dropdown_datastructure { close(FH); if ($code ne '') { - my $href = 'javascript:insertText(\'' . &convert_for_js(&HTML::Entities::encode($code)) . '\')'; + my $href = 'javascript:insertText(\'' . &convert_for_js(&HTML::Entities::encode($code,'<>&"')) . '\')'; my $currItem = [$href, $title, undef]; push @{$catItems}, $currItem; }