From 80c37ed56137aa2e15150aa6d2d45057d43305a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Kervella?= Date: Sat, 7 Oct 2017 16:48:19 +0000 Subject: [PATCH] Fix: Reset aussi la value dans le hidden quand on reset le tt_input --- machines/templatetags/bootstrap_form_typeahead.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/machines/templatetags/bootstrap_form_typeahead.py b/machines/templatetags/bootstrap_form_typeahead.py index fb95bb23..1d6770f6 100644 --- a/machines/templatetags/bootstrap_form_typeahead.py +++ b/machines/templatetags/bootstrap_form_typeahead.py @@ -176,7 +176,8 @@ def typeahead_js( f_name, f_value, t_choices, t_match_func ) : return render_tag( 'script', content=mark_safe( js_content ) ) def reset_input( f_name, f_value ) : - return '$("#'+input_id(f_name)+'").val("");' + return '$("#'+input_id(f_name)+'").typeahead("val","");\n' \ + '$("#'+hidden_id(f_name)+'").val("");' def default_choices( f_value ) : return '[' + \