<form action="<?php echo $this->getUrl('customer/account/renewPost') ?>" method="post" id="form-validate">
<ul class="form-list">
<li>
<label for="charity_name" class="required"><em>*</em><?php echo __('Charity/Organisation Name') ?></label>
<div class="input-box">
<input type="text" name="charity_name" id="charity_name" value="<?php echo $block->escapeHtml($this->getCustomer()->getCharityName()) ?>" title="<?php echo __('Charity/Organisation Name') ?>" class="input-text required-entry" readonly="readonly" maxlength="50"/>
</div>
</li>
<li>
<label for="charity_email"><?php echo __('Charity E-mail Address') ?> </label>
<div class="input-box">
<input type="text" name="charity_email" id="charity_email" value="<?php echo $this->getCompanyEmail(); ?>" title="<?php echo __('Charity E-mail Address') ?>" class="input-text" maxlength="200"/>
</div>
</li>
<?php echo $block->getChildHtml('form.additional.info'); ?>
<div class="buttons-set form-buttons">
<button type="button" class="button" title="<?php echo __('Save') ?>" onclick="var validator = jQuery('#form-validate').validate(); validator.form();checkEmailAddresses()"><span><span><?php echo __('Save') ?></span></span></button>
</div>
<script type="text/javascript">
function checkEmailAddresses()
{
var url = '<?php echo $this->getCheckEmailUrl(); ?>';
var mgmntEmail = jQuery('#manage\\:email').val();
var adminEmail = jQuery('#admin\\:email').val();
jQuery.ajax({
method: 'POST',
url: url,
data: {mgmntEmail: mgmntEmail, adminEmail: adminEmail},
success: function(response) {
if(response.indexOf("ok") > -1)
{
jQuery('#form-validate').submit();
}
else
{
alert(response);
}
}
});
}
</script>