我已经复制了例程如何针对Domino Access Service执行后期操作,其灵感来自此处描述的示例:
http://www.browniesblog.com/A55CBC/blog.nsf/dx/09042013111234MBRF6E.htm?opendocument
问题是除了Form属性之外,所有属性都会被提交。这是为什么?
$(document).ready(function() {
$(".btnRegister").click(function(e) {
var firstName = $(".firstName").val();
var lastName = $(".lastName").val();
var email = $(".email").val();
var password = $(".wannebepassword").val();
var newName = $(".firstName").val() + " " + $(".lastName").val();
if (newName !== " ") {
var newPersonObj = {Form: "Person", FirstName: firstName, LastName: lastName, FullName: newName, InternetAddress: email, HTTPPassword: password, Form: "Person"};
$.ajax({
url: 'http://server/names.nsf/api/data/documents',
type: 'POST',
data: JSON.stringify(newPersonObj),
dataType: 'xml',
accepts: {
xml: 'text/xml',
text: 'text/plain'
},
contentType: "application/json"
}).done(function(data, textStatus, jqXHR) {
var newPersonLocation = jqXHR.getResponseHeader("Location");
$("#formResponse").html('Registration successfull. Location = <a href="' + newPersonLocation + '">' + newPersonLocation + '</a><br>' + $("#myConsole").html());
}).fail(function(jqXHR, textStatus, errorThrown) {
alert("Registration has failed:" + errorThrown );
console.log('Registration has failed.');
});
}
else {
alert("Please enter a name");
}
return false;
});
});
答案 0 :(得分:0)
尝试在表单中添加一个字段,其中包含名称(我建议使用HTML标记:ID)FORM,可使用默认值进行编辑:
Form
NB editable不是强制性的,也可以是Computed。