Code for making a confirm email field in Magento 1
In billing.phtml -> paste below code in billing.phtml at just below at already had email field.
<?php if(!$this->isCustomerLoggedIn()): ?>
<div class="form-group">
<label for="billing:confirm_email" class="required"><?php echo $this->__('Confirm Email Address') ?> <em>*</em></label>
<input type="text" name="billing[confirm_email]" id="billing:confirm_email" title="<?php echo $this->__('Confirm Email Address') ?>" class="input-text form-control validate-cemail required-entry" />
</div>
<?php endif; ?>
Then open validation.js which is located at js/prototype/validation.js
and paste below code at just below the line => return !(pass.length < 7)
['validate-cemail', 'Please make sure your emails match.', function(v) {
var conf = $$('.validate-cemail')[0];
var pass = false;
if ($('email')) {
pass = $('email');
}
var emailElements = $$('.validate-email');
for (var i = 0; i < emailElements.size(); i++) {
var emailElement = emailElements[i];
if (emailElement.up('form').id == conf.up('form').id) {
pass = emailElement;
}
}
if ($$('.validate-admin-email').size()) {
pass = $$('.validate-admin-email')[0];
}
return (pass.value == conf.value);
}],