The WebForm / WebCall library by lirax.ua (PBX Cloud Platform)
> The JS library for sending web form and web calls to lirax.net (Phone Cloud System)
In a browser:
``html`
CDN:
`html`
Using npm:
`shell`
npm install xwtools --save
ES6
`js`
import tools from 'xwtools';
`html`
`html`$3
add class from targetClass (see below) to form and link inside it (if needed)
input filds with attribute name = 'phone' is required
phone must be more then 8 digits
`html`
`js
window.onload=function(){
var tool = new xwtools();
tool.liraxWebPhoneInit({
widgetId: "",
targetClass: "lirax-make-call",
scriptUrl: ""
});
tool.liraxWebFormInit({
widgetId: "",
targetClass: "lirax-custom-form",
scriptUrl: "",
prefix: '+380',
infoMessage: 'Message from web site: ', //for chat dialog
successMessage: 'Data sent successfully!',
errorMessage: 'Data sent error!',
nameError: 'must be not empty and more then 3 letters',
phoneError: 'must be not empty and more then 8 digits',
onSubmit: function() {
console.log('submit');
},
onSuccess: function() {
console.log('success');
},
onError: function() {
console.log('error');
}
});
tool.liraxWebCallInit({
widgetId: "",
targetClass: "lirax-custom-callback-form",
scriptUrl: "",
prefix: '+380',
successMessage: 'Data sent successfully!',
errorMessage: 'Data sent error!',
phoneError: 'must be not empty and more then 8 digits',
onSubmit: function() {
console.log('submit');
},
onSuccess: function() {
console.log('success');
},
onError: function() {
console.log('error');
}
});
}
``