Domino 访问服务 - 表单 属性 未提交
Domino Access Service - Form property not submitted
我复制了如何对 Domino 访问服务执行 post 操作的例程,灵感来自此处描述的示例:
http://www.browniesblog.com/A55CBC/blog.nsf/dx/09042013111234MBRF6E.htm?opendocument
问题是除了表单 属性 之外的所有属性都被提交了。这是为什么?
$(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;
});
});
尝试在您的表单中添加一个字段,名称为(我也建议 HTML 标记:ID)FORM,可使用默认值编辑:
Form
NB editable 不是必须的,Computed 也是可以的。
我复制了如何对 Domino 访问服务执行 post 操作的例程,灵感来自此处描述的示例:
http://www.browniesblog.com/A55CBC/blog.nsf/dx/09042013111234MBRF6E.htm?opendocument
问题是除了表单 属性 之外的所有属性都被提交了。这是为什么?
$(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;
});
});
尝试在您的表单中添加一个字段,名称为(我也建议 HTML 标记:ID)FORM,可使用默认值编辑:
Form
NB editable 不是必须的,Computed 也是可以的。