I am using backendless.com as a BaaS. So, I can not add objects to existing table. That`s why I am creating table in my .js file:
function Contacts(args) {
args = args || {};
this.age = args.age || "";
this.name = args.name || "";
this.title = args.title || "";
}
function sendData () {
var age = document.getElementById("age").value,
name = document.getElementById("name").value,
title = document.getElementById("title").value;
var requestObject = new Contacts( {
age: age,
name: name,
title: title,
});
var savedRequest = Backendless.Persistence.of( Contacts ).save( requestObject );
}
This is index.html file:
<form onsubmit="sendData()">
<input type="text" placeholder="age" id="age"><br>
<input type="text" placeholder="name" id="name"><br>
<input type="text" placeholder="title" id="title"><br>
<input type="submit" value="Submit">
</form>
But what I need is to add objects to tables which I already created in Backendless.com. I have table called: Contacts with columns: age, name, title. How should I do that?