I have a js file take attribute from a form and send it to doctype api post to create a new doctype
here is the api , http://localhost:8000/api/resource/pcontatcus
i used postman to test it and it’s working with no problem .
the js file
$(function(){
$(“#add47”).click(function(e){
e.preventDefault();
var name = $(“#pname”).val();
var age = $(“#age”).val();
var note = $(“#note”).val();
var post = {"data":JSON.stringify({"pname":name,"age":age,"note":note})};
$.post("http://localhost:8000/api/resource/pcontatcus",post,function(data){
alert("G00D");
});
});