| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| snippets:checkout:adding_email_confirmation_field_to_the_checkout [2011/05/26 18:09] – [Data entry] sami.fiaz | snippets:checkout:adding_email_confirmation_field_to_the_checkout [2017/04/26 07:02] (current) – external edit 127.0.0.1 |
|---|
| |
| <code javascript><script type="text/javascript" charset="utf-8"> | <code javascript><script type="text/javascript" charset="utf-8"> |
| var verifyEmail = '<li id="li_customer_email_verify" class="fc_row fc_customer_email_verify">'; | jQuery(document).ready(function() { |
| verifyEmail += '<label class="fc_label_left" for="customer_email_verify">Retype Email<span class="fc_ast">*</span></label>'; | var verifyEmail = '<li id="li_customer_email_verify" class="fc_row fc_customer_email_verify">'; |
| verifyEmail += '<input type="text" value="" autocomplete="off" class="fc_text fc_text_long fc_required" id="customer_email_verify" name="customer_email_verify"/>'; | verifyEmail += '<label class="fc_label_left" for="customer_email_verify">Retype Email<span class="fc_ast">*</span></label>'; |
| verifyEmail += '<label style="display: none;" class="fc_error" id="customer_email_verify_error" for="customer_email_verify">Please verify your email address.</label>'; | verifyEmail += '<input type="text" value="" autocomplete="off" class="fc_text fc_text_long fc_required" id="customer_email_verify" name="customer_email_verify"/>'; |
| verifyEmail += '</li>'; | verifyEmail += '<label style="display: none;" class="fc_error" id="customer_email_verify_error" for="customer_email_verify">Please verify your email address.</label>'; |
| jQuery(verifyEmail).insertAfter('#li_customer_email'); | verifyEmail += '</li>'; |
| // Now add the onblur error checking events | jQuery(verifyEmail).insertAfter('#li_customer_email'); |
| jQuery("#customer_email_verify").blur(function() { | // Now add the onblur error checking events |
| if (this.value == "") { | jQuery("#customer_email_verify").blur(function() { |
| FC.checkout.updateErrorDisplay(this.name,true); | if (this.value == "") { |
| } else if (this.value != "" && this.value != jQuery('#customer_email').val()){ | FC.checkout.updateErrorDisplay(this.name,true); |
| jQuery('label[for="customer_email_verify"].fc_error').text("Email address does not match."); | } else if (this.value != "" && this.value != jQuery('#customer_email').val()) { |
| FC.checkout.updateErrorDisplay(this.name,true); | jQuery('label[for="customer_email_verify"].fc_error').text("Email address does not match."); |
| }else{ | FC.checkout.updateErrorDisplay(this.name,true); |
| FC.checkout.updateErrorDisplay(this.name,false); | } else { |
| } | FC.checkout.updateErrorDisplay(this.name,false); |
| }); | } |
| jQuery("#customer_email").blur(function() { | }); |
| if (this.value != "" && this.value == jQuery('#customer_email_verify').val()){ | jQuery("#customer_email").blur(function() { |
| FC.checkout.updateErrorDisplay(jQuery('#customer_email_verify').attr('name'),false); | if (this.value != "" && this.value == jQuery('#customer_email_verify').val()) { |
| }else if (this.value != "" && this.value != jQuery('#customer_email_verify').val()){ | FC.checkout.updateErrorDisplay(jQuery('#customer_email_verify').attr('name'),false); |
| FC.checkout.updateErrorDisplay(jQuery('#customer_email_verify').attr('name'),true); | } else if (this.value != "" && this.value != jQuery('#customer_email_verify').val()) { |
| } | FC.checkout.updateErrorDisplay(jQuery('#customer_email_verify').attr('name'),true); |
| | } |
| | }); |
| }); | }); |
| </script></code> | </script></code> |