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.ph...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.
Code:
<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.
Code:
<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?
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?
Re: Prevent copy paste of email confirmation in Confirm Email Address Entry plugin
I also tried by adding
Code:
ondragstart="return false" onselectstart="return false"
on tpl_modules_create_account.php which gave this:
Code:
<?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:
Code:
<?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.
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
Re: Prevent copy paste of email confirmation in Confirm Email Address Entry plugin
Ok, thanks for that. I will take a look.
Re: Prevent copy paste of email confirmation in Confirm Email Address Entry plugin
No luck... I added this:
Code:
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:
HTML Code:
<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
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?
Re: Prevent copy paste of email confirmation in Confirm Email Address Entry plugin
I'm still looking for help on this.
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.
Re: Prevent copy paste of email confirmation in Confirm Email Address Entry plugin
Quote:
Originally Posted by
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..