Uncaught TypeError: Cannot read property 'title' of undefined
Hi there,
I am using the plugin "multipage" - and I'm using it on an install of Magento Enterprise for the user registration account page.
I have seem to set everything up correctly, But it looks as though it's just not working for me. here is the page:
http://dev.domainindustries.com/customer/account/create/Here is the error being thrown:
I can't figure out of that's causing multipage to work or not.
Here is my page head code:
- <head>
- <?php echo $this->getChildHtml('head') ?>
- <script type="text/javascript" src="<?php echo $this->getJsUrl('multipage/jquery.multipage.js') ?>"></script>
- <script type="text/javascript">
- jQuery.noConflict();
- jQuery('#myform').multipage({transitionFunction:transition,hideLegend: true,stateFunction: textpages});
- function transition(from,to) {
- jQuery(from).fadeOut('fast',function(){$(to).fadeIn('fast');});
-
- }
- function textpages(obj,page,pages) {
- jQuery(obj).html(page + ' of ' + pages);
- }
- </script>
- </head>
and my form code:
- <div class="account-create">
- <!--<div class="page-title">
- <h1><?php echo $this->__('Create an Account') ?></h1>
- </div>-->
- <div class="StaticsBlockBanner">
- <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('register-static-block')->toHtml(); ?>
- </div>
- <div class="RegisterField">
- <?php echo $this->getChildHtml('form_fields_before')?>
- <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
-
- <form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="form-validate" enctype="multipart/form-data">
- <fieldset id="page_one">
- <div class="fieldset">
- <input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>" />
- <input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>" />
- <input type="hidden" name="is_subscribed" value="1" id="is_subscribed" />
- <h2 class="legend"><?php echo $this->__('Personal Information') ?></h2>
- <ul class="form-list">
-
- <li class="fields">
- <label for="company"><?php echo $this->__('Company') ?></label>
- <div class="input-box">
- <input type="text" name="company" id="company" value="<?php echo $this->htmlEscape($this->getFormData()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text" />
- </div>
- </li>
-
-
- <li class="fields">
- <?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getFormData())->toHtml() ?></li>
-
- <li class="fields">
- <label for="email_address" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
- <div class="input-box">
- <input type="text" name="email" id="email_address" value="<?php echo $this->htmlEscape($this->getFormData()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
- </div>
- </li>
-
- <li class="fields">
- <label for="telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
- <div class="input-box">
- <input type="text" name="telephone" id="telephone" value="<?php echo $this->htmlEscape($this->getFormData()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text required-entry" />
- </div>
-
- </li>
-
-
- <?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
- <?php if ($_dob->isEnabled()): ?>
- <li><?php echo $_dob->setDate($this->getFormData()->getDob())->toHtml() ?></li>
- <?php endif ?>
- <?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
- <?php if ($_taxvat->isEnabled()): ?>
- <li><?php echo $_taxvat->setTaxvat($this->getFormData()->getTaxvat())->toHtml() ?></li>
- <?php endif ?>
- <?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
- <?php if ($_gender->isEnabled()): ?>
- <li><?php echo $_gender->setGender($this->getFormData()->getGender())->toHtml() ?></li>
- <?php endif ?>
-
- </ul>
-
- </div>
- </fieldset>
- <fieldset id="page_two">
- <?php //if($this->getShowAddressFields()): ?>
- <div class="fieldset">
- <input type="hidden" name="create_address" value="1" />
- <h2 class="legend"><?php echo $this->__('Address Information') ?></h2>
- <ul class="form-list">
-
-
-
- <li class="wide">
- <label for="street_1" class="required"><em>*</em><?php echo $this->__('Street Address') ?></label>
- <div class="input-box">
- <input type="text" name="street[]" value="<?php echo $this->htmlEscape($this->getFormData()->getStreet(0)) ?>" title="<?php echo $this->__('Street Address') ?>" id="street_1" class="input-text required-entry" />
- </div>
-
- <?php for ($_i=2, $_n=$this->helper('customer/address')->getStreetLines(); $_i<=$_n; $_i++): ?>
- <div class="Clear" style="height:10px;"></div>
- <label for="street_2"><?php echo $this->__('Street Address 2') ?></label>
- <div class="input-box">
- <input type="text" name="street[]" value="<?php echo $this->htmlEscape($this->getFormData()->getStreet($_i - 1)) ?>" title="<?php echo $this->__('Street Address '.$_i) ?>" id="street_<?php echo $_i?>" class="input-text" />
- </div>
-
- <?php endfor ?>
- </li>
- <li class="fields">
- <div class="field2">
- <label for="city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
- <div class="input-box">
- <input type="text" name="city" value="<?php echo $this->htmlEscape($this->getFormData()->getCity()) ?>" title="<?php echo $this->__('City') ?>" class="input-text required-entry" id="city" />
- </div>
- </div>
- <div class="field2">
- <label for="region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
- <div class="input-box">
- <select id="region_id" name="region_id" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
- <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
- </select>
- <script type="text/javascript">
- //<![CDATA[
- $('region_id').setAttribute('defaultValue', "<?php echo $this->getFormData()->getRegionId() ?>");
- //]]>
- </script>
- <input type="text" id="region" name="region" value="<?php echo $this->htmlEscape($this->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text" />
- </div>
- </div>
- </li>
-
-
- <li class="fields">
- <div class="field2">
- <label for="zip" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
- <div class="input-box">
- <input type="text" name="postcode" value="<?php echo $this->htmlEscape($this->getFormData()->getPostcode()) ?>" title="<?php echo $this->__('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international required-entry" />
- </div>
- </div>
- <div class="field2">
- <label for="country" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
- <div class="input-box">
- <?php echo $this->getCountryHtmlSelect() ?>
- </div>
- </div>
- </li>
- <?php $addressAttributes = $this->getChild('customer_form_address_user_attributes');?>
- <?php if ($addressAttributes): ?>
- <?php $addressAttributes->setEntity($this->getAddress());?>
- <?php $addressAttributes->setFieldIdFormat('address:%1$s')->setFieldNameFormat('address[%1$s]');?>
- <?php $this->restoreSessionData($addressAttributes->getForm(), 'address');?>
- <?php echo $addressAttributes->setShowContainer(false)->toHtml()?>
- <?php endif;?>
- </ul>
- <input type="hidden" name="default_billing" value="1" />
- <input type="hidden" name="default_shipping" value="1" />
-
-
-
-
- </div>
- </fieldset>
- <fieldset id="page_three">
- <div class="fieldset">
- <h2 class="legend"><?php echo $this->__('Login Information') ?></h2>
- <ul class="form-list">
- <li class="fields">
- <label for="password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
- <div class="input-box">
- <input type="password" name="password" id="password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
- </div>
- </li>
- <li class="fields">
- <div class="field">
- <label for="confirmation" class="required"><em>*</em><?php echo $this->__('Confirm Password') ?></label>
- <div class="input-box">
- <input type="password" name="confirmation" title="<?php echo $this->__('Confirm Password') ?>" id="confirmation" class="input-text required-entry validate-cpassword" />
- </div>
- </div>
- </li>
-
-
- <!--<?php if ($this->isNewsletterEnabled()): ?>
- <li class="control">
- <div class="input-box">
- <input type="checkbox" name="is_subscribed" title="<?php echo $this->__('Sign Up for Newsletter') ?>" value="1" id="is_subscribed"<?php if($this->getFormData()->getIsSubscribed()): ?> checked="checked"<?php endif; ?> class="checkbox" />
- </div>
- <label for="is_subscribed"><?php echo $this->__('Sign Up for Newsletter') ?></label>
- </li>
- <?php endif ?>-->
-
-
- <?php $customerAttributes = $this->getChild('customer_form_user_attributes');?>
- <?php if ($customerAttributes): ?>
- <?php $customerAttributes->setShowContainer(false);?>
- <?php $this->restoreSessionData($customerAttributes->getForm());?>
- <?php echo $customerAttributes->toHtml()?>
- <?php endif;?>
-
-
- </ul>
- </div>
- </fieldset>
- <?php //endif; ?>
- <!--<div class="fieldset">
-
- </div> -->
- <div class="buttons-set form-buttons">
- <!--<p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><small>« </small><?php echo $this->__('Back') ?></a></p>-->
- <button type="submit" class="button" title="<?php echo $this->__('Submit') ?>"><span><span><?php echo $this->__('Submit') ?></span></span></button>
- </div>
- <!-- <p class="required"><?php echo $this->__('* Required Fields') ?></p> -->
- </form>
- </div>
- <script type="text/javascript">
- //<![CDATA[
- var dataForm = new VarienForm('form-validate', true);
- new RegionUpdater('country', 'region', 'region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'zip');
- Form.getElements('form-validate').each(function(element) {
- element.setAttribute('autocomplete', 'off');
- });
- //]]>
- </script>
- </div>
Please note that I had to run jquery in no conflict mode due to magento's use of prototype. I'm a bit new to this, so any help would be amazing.