From 868e5e0a3862cd729d923af8a30907eed1af75e4 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 21 Aug 2014 13:06:17 +0000 Subject: [PATCH] adding autocomplete attribute to et2_textbox and et2_passwd and use it in email wizzard/account to stop browser from accidently filling out empty fields --- etemplate/js/et2_widget_textbox.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/etemplate/js/et2_widget_textbox.js b/etemplate/js/et2_widget_textbox.js index b4048b2be6..5d2cbd27a1 100644 --- a/etemplate/js/et2_widget_textbox.js +++ b/etemplate/js/et2_widget_textbox.js @@ -68,6 +68,12 @@ var et2_textbox = et2_inputWidget.extend( "type": "string", "default": et2_no_init, "description": "Perl regular expression eg. '/^[0-9][a-f]{4}$/i'" + }, + "autocomplete": { + "name": "Autocomplete", + "type": "string", + "default": "", + "description": "Weither or not browser should autocomplete that field: 'on', 'off', 'default' (use attribute from form)" } }, @@ -107,6 +113,7 @@ var et2_textbox = et2_inputWidget.extend( if(this.options.type == "passwd") { this.input.attr("type", "password"); } + if (this.options.autocomplete) this.input.attr("autocomplete", this.options.autocomplete); } if(this.options.size) {