diff options
Diffstat (limited to 'ishtar_common')
| -rw-r--r-- | ishtar_common/widgets.py | 10 | 
1 files changed, 7 insertions, 3 deletions
| diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index e0556a7b7..f257801d8 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -117,12 +117,16 @@ class JQueryDate(forms.TextInput):              values = value.split('/')              if len(values) == 3:                  value = "%s-%s-%s" % (values[2], values[1], values[0]) +        if not attrs: +            attrs = {} +        attrs['autocomplete'] = 'off'          rendered = super(JQueryDate, self).render(name, value, attrs)          # use window.onload to be sure that datepicker don't interfere          # with autocomplete fields +        var_name = name.replace('-', '_')          rendered += """  <script type="text/javascript"><!--// -    function load_jquerydate_%(name)s(){ +    function load_jquerydate_%(var_name)s(){          $(".date-pickup").datepicker($.datepicker.regional["%(country)s"]);          var val = $("#id_%(name)s").val();          if(val){ @@ -133,9 +137,9 @@ class JQueryDate(forms.TextInput):              $("#id_%(name)s").val(val);          }      } -    $(window).load(load_jquerydate_%(name)s); +    $(window).load(load_jquerydate_%(var_name)s);  //--></script> -""" % {"name":name, "country":settings.COUNTRY} +""" % {"name":name, "var_name":var_name, "country":settings.COUNTRY}          return rendered  class JQueryAutoComplete(forms.TextInput): | 
