Fetchify Documentation
Fetchify
Sign Up
Contact
Fetchify
Sign Up
Contact
  • Getting Started
  • Integrations

    • BigCommerce
    • CS-Cart
    • Ecommerce Templates
    • EKM
    • Formstack
    • Magento 2
    • Microsoft Dynamics 365
    • NetSuite
    • nopCommerce
    • Odoo
    • OpenCart
    • osCommerce
    • PrestaShop
    • Salesforce
    • Shopify Plus
    • Shopware
    • VirtueMart
    • WooCommerce
    • Xero
    • Zen Cart
    • Zapier
    • Zoey
  • Browser Extension

    • Chrome Browser Extension Guide
    • Firefox Browser Extension Guide
  • JavaScript Library

    • Address Auto-Complete
    • UK Postcode Lookup
    • Phone Validation
    • Email Validation
    • Bank Validation
    • Tutorials

      • Address Auto-Complete Website Integration
      • Customising Address Auto-Complete
      • Address Auto-Complete On Two Forms
      • UK Postcode Lookup in 15 Minutes
      • UK Postcode Lookup On Two Forms (Billing & Shipping)
      • Using Address Auto-Complete in React
      • Using Address Auto-Complete in Vue
    • Sample Code

      • Client Side JavaScript Address Auto-Complete
      • JavaScript & HTML – Client Side Postcode Lookup
  • Address & Validation API

    • Address Auto-Complete
    • Phone Validation API
    • Email Validation API
    • Bank Validation API
  • UK Postcode Lookup API

    • UK Postcode Lookup
    • UK Postcode Lookup (XML)
    • UK Postcode Geocodes
    • Errors
    • Sample Code

      • Microsoft C# Wrapper
      • Microsoft C++ Example Application
      • JSON API integration with jQuery UI
      • PHP – Server Side UK Postcode Lookup
      • Python – UK Postcode Lookup Example
      • RealStudio/XOJO Example
      • Microsoft VB.Net Sample Code
  • Embedded Tech API

    • Embedded Tech API
  • End-of-Life Announcements

    • Plugins & Extensions

Address Auto-Complete On Two Forms

How To Apply Address Auto-Complete to Multiple Forms on the Same Page

The clickToAddress class can only be instantiated once. If you try to instantiate it twice, you will see the error "Uncaught Already initiated".

The class has an attach method that allows you to integrate with extra address forms. You should use this when you want to integrate with two or more forms on the same page.

The method accepts on object containing the form fields you want to integrate with.

cc = new clickToAddress(config);
cc.attach({
    search:     'search_field',
    town:       'addr_town',
    postcode:   'addr_postcode',
    county:     'addr_county',
    line_1:     'addr_line1'
});
cc.attach({
    search:     'search_field-2',
    town:       'addr_town-2',
    postcode:   'addr_postcode-2',
    county:     'addr_county-2',
    line_1:     'addr_line1-2'
});
Prev
Customising Address Auto-Complete
Next
UK Postcode Lookup in 15 Minutes