From 894e757f18424218a7fd7605f8b0dc079b786cce Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 21 Aug 2014 13:06:42 +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 --- emailadmin/templates/default/account.xet | 12 ++++++------ emailadmin/templates/default/wizard.smtp.xet | 4 ++-- emailadmin/templates/default/wizard.xet | 6 +++--- etemplate/js/et2_widget_textbox.js | 7 +++++++ 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/emailadmin/templates/default/account.xet b/emailadmin/templates/default/account.xet index 4cf485cffb..b9c00e0e68 100644 --- a/emailadmin/templates/default/account.xet +++ b/emailadmin/templates/default/account.xet @@ -62,13 +62,13 @@ - + - + @@ -98,11 +98,11 @@ - + - + @@ -208,12 +208,12 @@ - + - + diff --git a/emailadmin/templates/default/wizard.smtp.xet b/emailadmin/templates/default/wizard.smtp.xet index bb47aaf768..781e94ec7a 100644 --- a/emailadmin/templates/default/wizard.smtp.xet +++ b/emailadmin/templates/default/wizard.smtp.xet @@ -14,11 +14,11 @@ - + - + diff --git a/emailadmin/templates/default/wizard.xet b/emailadmin/templates/default/wizard.xet index 5642691de8..cebf5b352d 100644 --- a/emailadmin/templates/default/wizard.xet +++ b/emailadmin/templates/default/wizard.xet @@ -14,15 +14,15 @@ - + - + - + 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) {