Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
 All Forums
 Technical
 Advanced Tips and Tricks - NO QUESTIONS PLEASE
 Verify email address is correct (.asp only)
Author « Topic »  

dbdave
ECT Moderator

USA
10373 Posts

Posted - 11/05/2017 :  09:48:35  
ASP VERSIONS ONLY

We have a big problem with customers entering their email address incorrectly.
Often, it is just a typo.
We have a fair amount of products that customers can request a proof via email and when the email address is bad, we have to chase the customers down to fix the email address.
This can take days sometimes to get a customer on the phone.
Out of every 100 orders, we have an average of 3 with bad email address.
These 3 orders can take longer to fix the email issue than the time it takes to process the other 97 orders.

Here are some mods that allow for email verification on your .asp site. It adds a 2nd email (verify) field and must match before a user can proceed.

These were tested thouroughly on version 6.8.1, but you will need to test these carefuly as my site may not have all the same settings and parameters as your site.
These are modification to the core files and should only be perfomred if you are comfortable editing these files and understand the changes will need to be reinstalled upon every update.
Backups should be saved of the unmodded files should you need to reactivate them.
No warranty is expressed or implied.

This will allow you to add a 2nd email feild where customers are entering email addresses for the first time.
It is not used where they simply log in and they will not need to fill in the 2nd email field if they have a saved email address, such as a cookie during a previous checkout.

The primary goal of this is to force customers to check that they have entered their correct email address.

On my site, I have three places where this is installed and all of them are covered below.
You do not have to use all three of them, all of them will work independently.


**************************
STEP 1
**************************

All these three mods will use a name for your 2nd email form and you will enter that in your vsadmin/includes.asp file
add these two lines - do not miss the ' at the beginning of line 1 there
change Re-enter Email to anything you like

'below is for custom mod for verify email match
xxEmailver="Re-enter Email"

**************************
MOD 1 - ADD TO CART CHECKOUT
**************************

WARNING - Make a copy and name it inc/inccart-unmodded.asp before making modification - this will be ready on stanby if you have any issues - you would replace the modded file with the unmodded, naming it back to inc/inccart.asp

FILE TO MODIFY inc/inccart.asp VERSION 6.8.1

**************************** STEP 1
This establishes the variable so the 2nd email address can be remembered and it cleans a bad email/malicious entry using the ect cart built in cleaner.

about line 2530

locate this line
ordEmail=cleanupemail(getpost("email"))

add a line so it's like this (added line shown in blue)
ordEmail=cleanupemail(getpost("email"))
ordEmail2=cleanupemail(getpost("email2"))

**************************** STEP 2
This tirggers the errors when a user does not fill in the 2nd email field correctly - it is ignored when a customer has a client account, because the email address will have already been established. It is also ignored once the user has verified his address and moved on to the last stage of checkout.

about line 2734 locate this line
if ordEmail="" AND NOT amazonpayment then errordemail=setcheckouterr("You must enter a valid email address.")

add two lines so it's like this (added lines shown in blue)
if ordEmail="" AND NOT amazonpayment then errordemail=setcheckouterr("You must enter a valid email address.")
if SESSION("clientID")="" AND ordEmail2="" AND getpost("shipselectoraction")="" AND NOT amazonpayment then errordemail=setcheckouterr("You must enter a valid email address for the email Verification and it must match.")
if SESSION("clientID")="" AND ordEmail2 <> ordEmail AND getpost("shipselectoraction")="" AND NOT amazonpayment then errordemail=setcheckouterr("Email verify does not match.")

**************************** STEP 3
This adds the extra email field and has some .asp code that will tell the email verify field to populate when a user is logged in or has selected the option to save their information on a previous checkout session. Then they are not bothered to fill in the 2nd email field. It will pre-populate

about line 4356 locate this
<div class="billformrow" style="display:none">
<div class="cobhl cobhl2 cdformtemail<%=IIfVs(errordemail," ectwarning")%>"><%=redstar & labeltxt(xxEmail,"email")%></div>
<div class="cobll cobll2 cdformemail"><input type="email" name="email" class="cdforminput cdformemail" id="email" size="25" value="<%=ordEmail%>" /></div>
</div>

add lines right under it so it's like this (added lines shown in blue)
<div class="billformrow" style="display:none">
<div class="cobhl cobhl2 cdformtemail<%=IIfVs(errordemail," ectwarning")%>"><%=redstar & labeltxt(xxEmail,"email")%></div>
<div class="cobll cobll2 cdformemail"><input type="email" name="email" class="cdforminput cdformemail" id="email" size="25" value="<%=ordEmail%>" /></div>
</div>
<% if request.cookies("id2")<>"" then
ordEmail2 = ordEmail
elseif SESSION("clientID")<>"" then
ordEmail2 = ordEmail
end if %>
<div class="billformrow" style="display:none">
<div class="cobhl cobhl2 cdformtemail<%=IIfVs(errordemail," ectwarning")%>"><%=redstar & labeltxt(xxEmailver,"email")%></div>
<div class="cobll cobll2 cdformemail"><input type="email2" name="email2" class="cdforminput cdformemail" id="email2" size="25" value="<%=ordEmail2%>" /></div>
</div>


You should end up with something like


**************************
MOD 2 - NEW CLIENT SIGNUP
**************************

WARNING - Make a copy and name it inc/incfunctions-unmodded.asp before making modification - this will be ready on stanby if you have any issues - you would replace the modded file with the unmodded, naming it back to inc/incfunctions.asp

FILE TO MODIFY inc/incfunctions.asp VERSION 6.8.1

**************************** STEP 1
here we are changing the javascript fuction that runs when the signup form is submitted.

search for cartaccloginalsubmit
there should only be one instance about line 2844

locate this line
print "<div class=""cartaccloginalsubmit"">" & imageorbutton(imgcreateaccount,xxCrNwAc,"createaccount","checknewaccount()",TRUE) & "</div>"

replace that line so it's like this (shown in blue)
print "<div class=""cartaccloginalsubmit"">" & imageorbutton(imgcreateaccount,xxCrNwAc,"createaccount","return ckemailandsubmit()",TRUE) & "</div>"

**************************** STEP 2
here we take the fist line and add the needed "id" and we add the 2nd email verify field

locate this line about line 2821 -
print "<div class=""cartaccloginemail_cntnr""><div class=""cartaccloginemailtext"">" & redstar & labeltxt(xxEmail,"email") & "</div><div class=""cartaccloginemail""><input type=""email"" name=""email"" size=""30"" value="""" /></div></div>"

replace it with these lines so it's like this (shown in blue)
print "<div class=""cartaccloginemail_cntnr""><div class=""cartaccloginemailtext"">" & redstar & labeltxt(xxEmail,"email") & "</div><div class=""cartaccloginemail""><input type=""email"" name=""email"" id=""email"" size=""30"" value="""" /></div></div>"
print "<div class=""cartaccloginemail_cntnr""><div class=""cartaccloginemailtext"">" & redstar & labeltxt(xxEmailver,"email") & "</div><div class=""cartaccloginemail""><input type=""email"" name=""email"" id=""email2"" size=""30"" value="""" /></div></div>"

**************************** STEP 3
here we add two javascript functions. The ckemailandsubmit runs first. It allows the verification of the email match (chkstr) first, and "only" if it's a match, then run the original ect function (checknewaccount) that would normally run when clicking the submit button.

next, search for (about line 2791)
function hideaccounts(){
if(document.getElementById('liemail')) document.getElementById('liemail').disabled=true;
document.getElementById('alopaquediv').style.display='none';
document.getElementById('acopaquediv').style.display='none'
return false;
}

below that add the following so it's like this (added lines shown in blue)
function hideaccounts(){
if(document.getElementById('liemail')) document.getElementById('liemail').disabled=true;
document.getElementById('alopaquediv').style.display='none';
document.getElementById('acopaquediv').style.display='none'
return false;
}
function chkstr(){
var Eml1=document.getElementById("email").value;
var Eml2=document.getElementById("email2").value;

if(Eml1 != Eml2) {
alert("Email addresses do not match.");
return false;
}
}
function ckemailandsubmit() {
var retvalue;
retvalue = chkstr();
if(retvalue == false) { return retvalue; }
checknewaccount();
}


You should end up with something like


**************************
MOD 3 - MINI CSS NEWSLETTER SIGNUP (This is a separate item purchased from ECT, so you may not have this file)
**************************

FILE TO MODIFY inc/incminicss.asp VERSION 6.8.1

WARNING - Make a copy and name it inc/incminicss-unmodded.asp before making modification - this will be ready on stanby if you have any issues - you would replace the modded file with the unmodded, naming it back to inc/incminicss.asp

**************************** STEP 1
here we add to a few steps to the javascript function that processes this form. The first addition check to see if the extra field is blank and triggers a warning message. The second addition is where the two email fields are compared and gives a message when they are different.

AT LINE 166 There is the following
var mlsuemail=document.getElementById('mlsuemail');
if(mlsuemail.value==""){
alert("<%=jscheck(xxPlsEntr&" """&xxEmail)%>\".");
mlsuemail.focus();
return(false);
}

below that add the following so it's like this (added lines shown in blue)
var mlsuemail=document.getElementById('mlsuemail');
if(mlsuemail.value==""){
alert("<%=jscheck(xxPlsEntr&" """&xxEmail)%>\".");
mlsuemail.focus();
return(false);
}
var mlsuemail=document.getElementById('mlsuemail2');
if(mlsuemail.value==""){
alert("<%=jscheck(xxPlsEntr&" """&xxEmailver)%>\".");
mlsuemail.focus();
return(false);
}

Right below that is the following
var regex=/[^@]+@[^@]+\.[a-z]{2,}$/i;
if(!regex.test(mlsuemail.value)){
alert("<%=jscheck(xxValEm)%>");
mlsuemail.focus();
return(false);
}

below that add the following so it's like this (added lines shown in blue)
var regex=/[^@]+@[^@]+\.[a-z]{2,}$/i;
if(!regex.test(mlsuemail.value)){
alert("<%=jscheck(xxValEm)%>");
mlsuemail.focus();
return(false);
}
if(document.getElementById("mlsuemail").value != document.getElementById("mlsuemail2").value) {
alert("Email verify does not match. Please check the email address carefully.");
return false;
}

**************************** STEP 2

here we add the extra field to the form.

LINE 179 LOCATE
<form action="cart.asp" method="post" onsubmit="return mlvalidator(this)">
<input type="hidden" name="mode" value="mailinglistsignup" />
<input type="hidden" name="mlsectgrp1" id="mlsectgrp1" value="7418" />
<input type="hidden" name="mlsectgrp2" id="mlsectgrp2" value="6429" />
<input type="hidden" name="rp" value="<%=replace(replace(replace(therp,"""",""),"<",""),"&","&")%>" />
<label class="minimailsignup"><%=xxName%></label>
<input class="minimailsignup" type="text" name="mlsuname" id="mlsuname" value="" maxlength="50" />
<label class="minimailsignup"><%=xxEmail%></label>
<input class="minimailsignup" type="text" name="mlsuemail" id="mlsuemail" value="" maxlength="50" />
<%=imageorsubmit(imgmailformsubmit, xxSubmt, "minimailsignup minimailsubmit")%>
<div class="spacer"></div>
<input type="hidden" name="posted" value="1" />
</form>

add the following two lines so it's like this (added lines shown in blue)
<form action="cart.asp" method="post" onsubmit="return mlvalidator(this)">
<input type="hidden" name="mode" value="mailinglistsignup" />
<input type="hidden" name="mlsectgrp1" id="mlsectgrp1" value="7418" />
<input type="hidden" name="mlsectgrp2" id="mlsectgrp2" value="6429" />
<input type="hidden" name="rp" value="<%=replace(replace(replace(therp,"""",""),"<",""),"&","&")%>" />
<label class="minimailsignup"><%=xxName%></label>
<input class="minimailsignup" type="text" name="mlsuname" id="mlsuname" value="" maxlength="50" />
<label class="minimailsignup"><%=xxEmail%></label>
<input class="minimailsignup" type="text" name="mlsuemail" id="mlsuemail" value="" maxlength="50" />
<label class="minimailsignup"><%=xxEmailver%></label>
<input class="minimailsignup" type="text" name="mlsuemail2" id="mlsuemail2" value="" maxlength="50" />

<%=imageorsubmit(imgmailformsubmit, xxSubmt, "minimailsignup minimailsubmit")%>
<div class="spacer"></div>
<input type="hidden" name="posted" value="1" />
</form>

You should end up with something like

Edited by - dbdave on 05/29/2023 19:16:19

dbdave
ECT Moderator

USA
10373 Posts

Posted - 11/07/2017 :  07:04:25  
I have added this to the "ask a question" as well if anyone wants that.

dbdave
ECT Moderator

USA
10373 Posts

Posted - 11/08/2017 :  12:22:07  
It's been more than three days since we went live with this and not one bounced email on an order.
Not one customer has contacted us to let us know they don't like it, or having problems.
A big win for us I think.

midvalleydrifter001
Ecommerce Template Expert

USA
930 Posts

Posted - 11/08/2017 :  15:17:03  

I would love to see this in PHP

ross.fraser
Advanced Member

451 Posts

Pre-sales questions only
(More Details...)

Posted - 01/07/2018 :  17:41:44  
Hi Dave,

I think this is a great idea and I use it on my site.

I have found a problem however:

On an iPhone (both safari and chrome) the is an issue with the cursor alignment on the 'create new account' popup.

The cursor drops well below the field being filled and confuses the customer.

I tried it using chrome on an android and it is ok.

You site has the same issue as mine.

Any ideas?

cheers
Ross


Ross Fraser
ross@chain-me-up.com.au
https://www.chain-me-up.com.au

dbdave
ECT Moderator

USA
10373 Posts

Posted - 01/07/2018 :  19:40:05  
Hmm I don't have an Iphone, can you get me a screen shot so I can see the problem?

insight
ECT Moderator

USA
4479 Posts

Posted - 01/07/2018 :  20:49:36  
The cursor is floating around independent of the form fields as the form is scrolled up to fill in more fields, not much space for anything with the keyboard deployed:


Peter

ServeLink
Professional ecommerce web hosting for ASP & PHP
https://servelink.com

Take a look at our image upload/resize tool for the ASP cart
https://servelink.com/clients/cart?gid=7

dbdave
ECT Moderator

USA
10373 Posts

Posted - 01/08/2018 :  06:29:13  
Ok, thanks for the screen shot there Peter.

I will see if I can take a look this evening.
I have several irons in the fire at the moment, so it may be just a few days, but I expect we can find the issue and fix it.

David

dbdave
ECT Moderator

USA
10373 Posts

Posted - 01/08/2018 :  21:40:36  
It seems to be a bug and I'm not convinced at this point that adding one input line is the problem here.
Ross, have you tested this without mods?

I find numerous pages with info regarding input cursor positioning on modal windows being an issue in Safari and Chrome on Iphones.

https://bugs.webkit.org/show_bug.cgi?id=176896

I see many pages with all kinds of hacks to get around this, but being that I see many recent posts on the matter, I think they may fix it soon.

Ross, or Peter, have either of you checked this on an unmodded "new account" creation page?

David

insight
ECT Moderator

USA
4479 Posts

Posted - 01/08/2018 :  22:12:17  
It’s the same on a default site, like ectdemostore.com, but it’s less apparent as there’s only three form fields to squeeze in the gap between the header and the keyboard. If you don’t need to scroll to reach the bottom of the form you won’t see this behavior.

Peter

ServeLink
Professional ecommerce web hosting for ASP & PHP
https://servelink.com

Take a look at our image upload/resize tool for the ASP cart
https://servelink.com/clients/cart?gid=7

Marshall
Ecommerce Template Guru

USA
1896 Posts

Posted - 01/08/2018 :  23:01:29  
This is merely an observation. It has been my belief that phones are designed more with apps and simple browsing in mind rather than completing forms of any sort. Having read the posts on the link David provided, it seems Apple is in no hurry to address the problem. In my opinion, the problem is not the fault of the website but of the device. Kind of makes you long for the days when people only had PCs with 800 pixel wide monitors.

Marshall
CENLYT Productions - ms designs
Affordable Web Design
Custom Ecommerce Designs
Responsive Websites
Cenlyt.com

dbdave
ECT Moderator

USA
10373 Posts

Posted - 01/09/2018 :  06:27:10  
With all of this in mind, I have thought of a few things that may help but not sure if am going to implement them on my site.
.css could be used to "tighten" up the spacing there so "with" the fourth form field, the whole thing takes up about as much space as the original three.

Ross, you could just do away with the email verify on the new account signup only.

For my website, the client account feature is optional and less prominent on mobile devices. I actually have the login button hidden on the checkout/cart page as well.
I suppose that mobile users are less likely to create a new account on my site and that's why not one customer has brought this to my attention.

It seems like a good amount of "outcry" out there and I would think that apple would address this in a forthcoming release.

Ross, if you need help tweaking the css to try to overcome this, let me know and I'll will see what I can come up with .

PS - Having had the email verify features on my site for several months, I can say that we love it and it has reduced bad email addresses from customers to almost none.
For every 1000 orders, in the past, we would have 30+ orders come though with bad email addresses, now that average is less than 1.
We might see a bad email for 1 of every 2000-3000 orders.

David

Edited by - dbdave on 01/09/2018 11:18:16

ross.fraser
Advanced Member

451 Posts

Pre-sales questions only
(More Details...)

Posted - 01/10/2018 :  01:27:05  
Hi Dave,

I agree that this is a great feature and does stop (99.9%) of email address errors occurring.

The problem is that there is a bug that has been reported to apple but not fixed.

IF the parent container is set to postion:fixed then input fields may have alignment issues.

I fixed my site by changing these two lines in incfunctions.asp

print "<div id=""alopaquediv"" style=""display:none;position:fixed;width:100%;height:100%;background-color:rgba(140,140,150,0.5);top:0px;left:0px;z-index:10000"">"
print "<div id=""acopaquediv"" style=""display:none;position:fixed;width:100%;height:100%;background-color:rgba(140,140,150,0.5);top:0px;left:0px;z-index:10000"">"

to

print "<div id=""alopaquediv"" style=""display:none;position:[red]absolute[/red];width:100%;height:100%;background-color:rgba(140,140,150,0.5);top:0px;left:0px;z-index:10000"">"
print "<div id=""acopaquediv"" style=""display:none;position:[red]absolute[/red];width:100%;height:100%;background-color:rgba(140,140,150,0.5);top:0px;left:0px;z-index:10000"">"

much better


code found around line 2880 - Just search for id=""acopaquediv"" and id=""alopaquediv""

cheers
Ross




Ross Fraser
ross@chain-me-up.com.au
https://www.chain-me-up.com.au

dbdave
ECT Moderator

USA
10373 Posts

Posted - 01/10/2018 :  07:33:54  
That's great news Ross.
Thanks for the update.

Cheers,
David

insight
ECT Moderator

USA
4479 Posts

Posted - 01/10/2018 :  09:47:53  
Might be a good idea to propose this type of functionality as an (optional) addition to the core code. Every time I look at one of our mail servers there's always a pile of undeliverable ECT "thanks for your order" type emails sitting there because the customer made a mistake in his address, it's pretty common.

Verification is clearly not a complete cure as I have one here for one of Dave's customers xxxxx@hotmsol.com , but the anecdotal evidence above suggests it's quite effective.

Peter

ServeLink
Professional ecommerce web hosting for ASP & PHP
https://servelink.com

Take a look at our image upload/resize tool for the ASP cart
https://servelink.com/clients/cart?gid=7

dbdave
ECT Moderator

USA
10373 Posts

Posted - 01/10/2018 :  12:57:51  
anecdotal?
I can do the research and provide hard numbers, but I have a good grasp of the situation and I can provide "facts" if needed,
but one thing I am 100% sure of is that it has almost completely stopped the issue and that's good enough for me.

insight
ECT Moderator

USA
4479 Posts

Posted - 01/10/2018 :  13:08:55  
Well it's just one story, from one guy, so I'd call that anecdotal And I found a case from the last day where it failed to solve the problem. But I did also say it appeared effective and ought to be considered for the core code.

Peter

ServeLink
Professional ecommerce web hosting for ASP & PHP
https://servelink.com

Take a look at our image upload/resize tool for the ASP cart
https://servelink.com/clients/cart?gid=7

dbdave
ECT Moderator

USA
10373 Posts

Posted - 01/10/2018 :  14:14:29  
No worries Peter.

I added it to the suggestions forum for anyone who wants to add a vote there.
https://www.ecommercetemplates.com/support/topic.asp?TOPIC_ID=109282

Vince
Administrator

42674 Posts

Posted - 07/24/2018 :  03:37:18  
Thanks for this Dave and I've made the changes now to add this to the core cart code. When the changes have been tested I'll get them added to the updater.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.05 seconds. Snitz Forums 2000