Zen Cart Logo
Forums / General Questions / Prevent copy paste of email confirmation in Confirm Email Address Entry plugin

Prevent copy paste of email confirmation in Confirm Email Address Entry plugin

Views: 3,519

Results 1 to 10 of 10
22 Oct 2013, 5:56 PM
#1
alexthibo avatar

alexthibo

New Zenner

Join Date:
Jul 2012
Posts:
99
Plugin Contributions:
0

Prevent copy paste of email confirmation in Confirm Email Address Entry plugin

Hi there,
I've installed the Confirm Email Address Entry plugin which work great. (http://www.zen-cart.com/downloads.php?do=file&id=107http://www.zen-cart.com/downloads.php?do=file&id=107)

I would like to push it a little bit further since the email address validity is really important for this store purposes (updates and files will periodically be send by email) and I understand the points in all the discussions about the email verification in the account creation, and I agree with them.

So, I would like to remove the possibility to make a copy paste in the second field of the email confirmation.

I found way on a php website which is the following:

First include the jquery file in between the <head> tag.

<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>

Then add the following code to the <head> tag, below the include script.

<script type="text/javascript">// <![CDATA[
 $(document).ready(function () {
 $('#id_of_textbox').bind('copy paste', function (e) {
 e.preventDefault();
 });
 });
 // ]]>
 </script>

But, and that's probably a really stupid question, where is the <head> tag?

27 Oct 2013, 12:33 AM
#2
alexthibo avatar

alexthibo

New Zenner

Join Date:
Jul 2012
Posts:
99
Plugin Contributions:
0

Re: Prevent copy paste of email confirmation in Confirm Email Address Entry plugin

I placed these codes in html_header.php and changed '#id_of_textbox' by email-address-confirm which is the id if the confirmation text box but it did absolutely nothing. I still can copy the email and post it in the confirmation text box.

Any idea of an other way I can prevent to paste the confirmation mail?

27 Oct 2013, 1:31 AM
#3
alexthibo avatar

alexthibo

New Zenner

Join Date:
Jul 2012
Posts:
99
Plugin Contributions:
0

Re: Prevent copy paste of email confirmation in Confirm Email Address Entry plugin

I also tried by adding ```
ondragstart="return false" onselectstart="return false"

<?php echo zen_draw_input_field('email_address_confirm', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_email_address', '40') . ' id="email-address-confirm"') . (zen_not_null(ENTRY_EMAIL_ADDRESS_CONFIRM) ? '<span class="alert">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>': ''); ?>

and also in tpl_account_edit_default.php which gave this:
<?php echo zen_draw_input_field('email_address_confirm', $account->fields['customers_email_address'], 'id="email-address-confirm" ondragstart="return false" onselectstart="return false"') . (zen_not_null(ENTRY_EMAIL_ADDRESS_CONFIRM) ? '<span class="alert">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>': ''); ?>

No result. So I tried many other js code but again, absolutely no result. :( So please, any help in this will be appreciated guys. I just don't get it.
27 Oct 2013, 1:54 AM
#4
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: Prevent copy paste of email confirmation in Confirm Email Address Entry plugin

Take a look in (1.5.1) admin/login.php
You will find nemerous occurrences of autocomplete="off"
Viewing this file should give you lots of good ideas

27 Oct 2013, 10:11 AM
#5
alexthibo avatar

alexthibo

New Zenner

Join Date:
Jul 2012
Posts:
99
Plugin Contributions:
0

Re: Prevent copy paste of email confirmation in Confirm Email Address Entry plugin

Ok, thanks for that. I will take a look.

27 Oct 2013, 11:10 AM
#6
alexthibo avatar

alexthibo

New Zenner

Join Date:
Jul 2012
Posts:
99
Plugin Contributions:
0

Re: Prevent copy paste of email confirmation in Confirm Email Address Entry plugin

No luck... I added this:

 onCopy="return false" onDrag="return false" onDrop="return false" onPaste="return false" autocomplete="off"

In both the email and the email-confirmation text boxes of both files: tpl_account_edit_default.php and tpl_modules_create_account.php. So the code looks like that:

<label class="inputLabel" for="email-address" onCopy="return false" onDrag="return false" onDrop="return false" onPaste="return false" autocomplete="off"><?php echo ENTRY_EMAIL_ADDRESS; ?></label>

<?php echo zen_draw_input_field('email_address', $account->fields['customers_email_address'], 'id="email-address"') . (zen_not_null(ENTRY_EMAIL_ADDRESS_TEXT) ? '<span class="alert">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>': ''); ?>

<br class="clearBoth" />

<label class="inputLabel" for="email-address-confirm" onCopy="return false" onDrag="return false" onDrop="return false" onPaste="return false" autocomplete="off"><?php echo ENTRY_EMAIL_ADDRESS_CONFIRM; ?></label>

<?php echo zen_draw_input_field('email_address_confirm', $account->fields['customers_email_address'], 'id="email-address-confirm"') . (zen_not_null(ENTRY_EMAIL_ADDRESS_CONFIRM) ? '<span class="alert">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>': ''); ?>

<br class="clearBoth" />

Again, absolutely no difference on the possibility to copy/paste. That should work but it doesn't. How is this possible?

If someone want to take a look to help me on this, the adresse of the store is http://www.fc4x4q.com/boutique

5 Nov 2013, 2:44 AM
#7
alexthibo avatar

alexthibo

New Zenner

Join Date:
Jul 2012
Posts:
99
Plugin Contributions:
0

Re: Prevent copy paste of email confirmation in Confirm Email Address Entry plugin

No one can help on this one?

All those who installed the Confirm Email Address Entry plugin really don't care about beeing able to just copy and paste the email in the confirmation field and then bypass this plugin?

15 Nov 2013, 4:16 AM
#8
alexthibo avatar

alexthibo

New Zenner

Join Date:
Jul 2012
Posts:
99
Plugin Contributions:
0

Re: Prevent copy paste of email confirmation in Confirm Email Address Entry plugin

I'm still looking for help on this.

15 Nov 2013, 12:39 PM
#9
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Prevent copy paste of email confirmation in Confirm Email Address Entry plugin

As I understand it, autocomplete="off" won't solve your issue anyway. It only turns off (sometimes) the dropdown that appears below an entry box populated with whatever text you have entered in that box before. In the case of creating a Zencart account, the second email address box won't have had anything entered before. It has nothing to do with Copy and Paste.

My (unsolicited) advice is to forget it. It's probably doable by someone well versed in Javascript, but like the meaningless attempts to disable right-clicking of images, any user who has Javascript disabled won't see it.

15 Nov 2013, 3:23 PM
#10
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Prevent copy paste of email confirmation in Confirm Email Address Entry plugin

stevesh:

As I understand it, autocomplete="off" won't solve your issue anyway. It only turns off (sometimes) the dropdown that appears below an entry box populated with whatever text you have entered in that box before. In the case of creating a Zencart account, the second email address box won't have had anything entered before. It has nothing to do with Copy and Paste.

**My (unsolicited) advice is to forget it. It's probably doable by someone well versed in Javascript, but like the meaningless attempts to disable right-clicking of images, any user who has Javascript disabled won't see it.**and to add to this if the OP REALLY needs this and he isn't having luck getting help with this here, he should CONSIDER investing in the services of a developer who can knock this code out for him..