Skip to content
This repository has been archived by the owner on Feb 17, 2020. It is now read-only.

Latest commit

 

History

History

public

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Javascript API Documentation

API for Phone is accessible in global object window.IPub.Forms.Phone.

Loading

Server-side part of Phone form element is element with custom data attribute data-ipub-forms-phone. This element can be initialized with method init().

var phone = new IPub.Forms.Phone($('[data-ipub-forms-phone]'));
    phone.init();

But there is shortcut implemented as jQuery plugin:

$('[data-ipub-forms-phone]').ipubFormsPhone();

You can chain other jQuery methods after this as usual. If you try to initialize one Phone twice, it will fail silently (second initialization won't proceed).

Finally you can initialize phone field on the page by calling:

IPub.Forms.Phone.load();

This plugin is initialized automatically, so you don't need to add another calls, you just need to inject JS file into your page.