我有一个完全静态的html表单,其中包含一些使用netlify标记的数据。提交时,我得到200并看到默认的成功页面,但是在Netlify仪表板中看不到提交。我确实看到该表单已被识别,并且在仪表板上有一个条目,但是它显示了零提交。
请注意,我的问题不同于a similar question,因为这是静态表单,并且我的内容类型已经是“ application / x-www-form-urlencoded”,在其他情况下这是错误的。 / p>
我没有看到其他人描述此问题,而且我似乎在文档中找不到任何我可能会丢失的东西。有人见过这个,找到了解决办法吗?
这是表格:
<form name="registration" method="POST" class="registration-form" data-netlify="true" data-netlify-recaptcha="true">
<H2>Juneteenth Parade Registration Form</H2>
<p>The deadline to register for the parade is Fri. May 31, 2019.</p>
<fieldset>
<legend>CONTACT INFORMATION</legend>
<div class="registration-form">
<label for="name">Organization Name:</label><input type="text" id="name" name="name" required minlength="4" maxlength="128" size="64">
</div>
<div class="registration-form">
<label for="contact">Contact Person:</label><input type="text" id="person" name="person" required minlength="4" maxlength="128" size="64">
</div>
<div class="registration-form">
<label for="address">Organization Address:</label><input type="text" id="address" name="address" required minlength="4" maxlength="128" size="64">
</div>
<div class="registration-form">
<label for="phone">Phone Number:</label><input type="tel" pattern="[0-9]{3}-[0-9]{3}-[0-9]{4}" placeholder="###-###-####" id="phone" name="phone" required minlength="7" maxlength="28" size="14">
</div>
<div class="registration-form">
<label for="alt_phone">Alternate Phone:</label><input type="tel" pattern="[0-9]{3}-[0-9]{3}-[0-9]{4}" placeholder="###-###-####" id="alt_phone" name="alt_phone" required minlength="7" maxlength="28" size="14">
</div>
<div class="registration-form">
<label for="email">E-mail Address:</label><input type="email" id="email" name="email" required minlength="4" maxlength="128" size="32">
</div>
</fieldset>
<fieldset>
<legend>PARADE ENTRY</legend>
<div class="description">
<label for="description">Please describe the nature of your parade entry for example; float, people walking together, band, horse and buggy, decorated car, bicycles and banners.</label> <textarea id="description" name="description" rows="3" cols="64">
</textarea>
</div>
<div class="registration-form">
<input type="checkbox" id="music" name="music">
<label for="music">Playing or performing music?</label>
</div>
<div class="number-of-people">
<label for="people">Number of people expected:</label><input type="number" id="email" name="email" required minlength="1" maxlength="4" size="4">
</div>
</fieldset>
<div data-netlify-recaptcha="true"></div>
<input type="submit" value="Submit Registration" class="submit button">
</form>
这是请求/响应:
{
"log": {
"version": "1.2",
"creator": {
"name": "WebInspector",
"version": "537.36"
},
"pages": [
{
"startedDateTime": "2019-04-14T21:45:06.072Z",
"id": "page_4",
"title": "https://redacted.netlify.com/",
"pageTimings": {
"onContentLoad": 364.39100000006874,
"onLoad": 418.19699999996374
}
}
],
"entries": [
{
"startedDateTime": "2019-04-14T21:45:06.070Z",
"time": 225.2770000000055,
"request": {
"method": "POST",
"url": "https://redacted.netlify.com/",
"httpVersion": "http/2.0",
"headers": [
{
"name": ":method",
"value": "POST"
},
{
"name": ":authority",
"value": "redacted.netlify.com"
},
{
"name": ":scheme",
"value": "https"
},
{
"name": ":path",
"value": "/"
},
{
"name": "content-length",
"value": "585"
},
{
"name": "pragma",
"value": "no-cache"
},
{
"name": "cache-control",
"value": "no-cache"
},
{
"name": "origin",
"value": "https://redacted.netlify.com"
},
{
"name": "upgrade-insecure-requests",
"value": "1"
},
{
"name": "content-type",
"value": "application/x-www-form-urlencoded"
},
{
"name": "user-agent",
"value": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"
},
{
"name": "accept",
"value": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3"
},
{
"name": "referer",
"value": "https://redacted.netlify.com/"
},
{
"name": "accept-encoding",
"value": "gzip, deflate, br"
},
{
"name": "accept-language",
"value": "en-US,en;q=0.9"
}
],
"queryString": [],
"cookies": [],
"headersSize": -1,
"bodySize": 585,
"postData": {
"mimeType": "application/x-www-form-urlencoded",
"text": "form-name=registration&name=Test+Org&person=Bill&address=111+Test+Dr.&phone=111-222-3333&alt_phone=444-555-6666&email=me%40example.com&description=This+is+a+test.++++++++++++++++++++++++++++&music=on&email=1&g-recaptcha-response=03AOLTBLTRjCCETaPINwgzeeptXELZzjz9ineERJ18sHv9_Pb4ou7P70RkIz4vqEJPMME01RnXgqSjs-0f_6TUjWEL3QkkFJSd2dThUktYnI5Y-Nwl8fJx4DMU9ZBPuL1MLM-vjOiRf2ZNHU13HxrSUk3ab9j31O4R8wnTtdpG_QiQwKMxZs-pM-_L29YBA1c4HGR1IZJlxGixjk06L50CLzc6cF9y_o6RHiZ8O33hJ_36sgTWEqjeSjZUU9XHRPFkkCUK9x5LK5P5j2HFOEjpA6NbOqHyTtLGUo8CnvgwlLDiovvwASyRD0vmz0gkMTHV1LBsjoAWkSACLz1o5dh2mpdsXVZUfZo-jA",
"params": [
{
"name": "form-name",
"value": "registration"
},
{
"name": "name",
"value": "Test+Org"
},
{
"name": "person",
"value": "Bill"
},
{
"name": "address",
"value": "111+Test+Dr."
},
{
"name": "phone",
"value": "111-222-3333"
},
{
"name": "alt_phone",
"value": "444-555-6666"
},
{
"name": "email",
"value": "me%40example.com"
},
{
"name": "description",
"value": "This+is+a+test.++++++++++++++++++++++++++++"
},
{
"name": "music",
"value": "on"
},
{
"name": "email",
"value": "1"
},
{
"name": "g-recaptcha-response",
"value": "[redacted]"
}
]
}
},
"response": {
"status": 200,
"statusText": "",
"httpVersion": "http/2.0",
"headers": [
{
"name": "status",
"value": "200"
},
{
"name": "content-type",
"value": "text/html"
},
{
"name": "date",
"value": "Sun, 14 Apr 2019 21:45:06 GMT"
},
{
"name": "age",
"value": "0"
},
{
"name": "server",
"value": "Netlify"
},
{
"name": "x-nf-request-id",
"value": "0cb00dd4-87f1-42a7-b737-913d0998120e-98519701"
}
],
"cookies": [],
"content": {
"size": 2121,
"mimeType": "text/html",
"text": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"utf-8\">\n\n <title>Thank you!</title>\n <link href='https://fonts.googleapis.com/css?family=Roboto:400,700&subset=latin,latin-ext' rel='stylesheet' type='text/css'>\n <style>\n body {\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";\n background: rgb(14, 30, 37);\n color: white;\n overflow: hidden;\n }\n\n h1 {\n margin: 0;\n font-size: 22px;\n line-height: 24px;\n }\n\n .main {\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100vh;\n width: 100vw;\n }\n\n .card {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 75%;\n max-width: 364px;\n padding: 24px;\n background: white;\n color: rgb(14, 30, 37);\n border-radius: 8px;\n box-shadow: 0 2px 4px 0 rgba(14, 30, 37, .16);\n }\n\n a {\n margin: 0;\n text-decoration: none;\n font-weight: 600;\n line-height: 24px;\n color: #00ad9f;\n }\n\n a svg {\n position: relative;\n top: 2px;\n }\n\n a:hover,\n a:focus {\n text-decoration: underline;\n color: #007A70;\n }\n\n a:hover svg path{\n fill: #007A70;\n }\n\n p:last-of-type {\n margin: 0;\n }\n </style>\n </head>\n <body>\n\n <div class=\"main\">\n <div class=\"card\">\n <div class=\"header\">\n <h1>Thank you!</h1>\n </div>\n <div class=\"body\">\n\n <p>Your form submission has been received.</p>\n\n <p>\n <a id=\"back-link\" href=\"/\">← Back to our site</a>\n </p>\n </div>\n </div>\n </div>\n <script>\n (function() {\n if (document.referrer && document.location.host && document.referrer.match(new RegExp(\"^https?://\" + document.location.host))) {\n document.getElementById(\"back-link\").setAttribute(\"href\", document.referrer);\n }\n })();\n </script>\n </body>\n</html>\n"
},
"redirectURL": "",
"headersSize": -1,
"bodySize": -1,
"_transferSize": 2210
},
"cache": {},
"timings": {
"blocked": 2.34500000006365,
"dns": -1,
"ssl": -1,
"connect": -1,
"send": 0.16100000000000003,
"wait": 221.8270000000515,
"receive": 0.9439999998903659,
"_blocked_queueing": 1.86600000006365
},
"serverIPAddress": "142.93.122.177",
"_initiator": {
"type": "other"
},
"_priority": "VeryHigh",
"_resourceType": "document",
"connection": "19503",
"pageref": "page_4"
},
{
"startedDateTime": "2019-04-14T21:45:06.311Z",
"time": 126.6409999998271,
"request": {
"method": "GET",
"url": "https://fonts.googleapis.com/css?family=Roboto:400,700&subset=latin,latin-ext",
"httpVersion": "http/2.0+quic/43",
"headers": [
{
"name": "Referer",
"value": "https://redacted.netlify.com/"
},
{
"name": "User-Agent",
"value": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"
}
],
"queryString": [
{
"name": "family",
"value": "Roboto:400,700"
},
{
"name": "subset",
"value": "latin,latin-ext"
}
],
"cookies": [],
"headersSize": -1,
"bodySize": 0
},
"response": {
"status": 200,
"statusText": "",
"httpVersion": "http/2.0+quic/43",
"headers": [
{
"name": "strict-transport-security",
"value": "max-age=31536000"
},
{
"name": "content-encoding",
"value": "br"
},
{
"name": "last-modified",
"value": "Sun, 14 Apr 2019 21:45:06 GMT"
},
{
"name": "server",
"value": "ESF"
},
{
"name": "access-control-allow-origin",
"value": "*"
},
{
"name": "date",
"value": "Sun, 14 Apr 2019 21:45:06 GMT"
},
{
"name": "x-frame-options",
"value": "SAMEORIGIN"
},
{
"name": "content-type",
"value": "text/css; charset=utf-8"
},
{
"name": "status",
"value": "200"
},
{
"name": "alt-svc",
"value": "quic=\":443\"; ma=2592000; v=\"46,44,43,39\""
},
{
"name": "cache-control",
"value": "private, max-age=86400, stale-while-revalidate=604800"
},
{
"name": "timing-allow-origin",
"value": "*"
},
{
"name": "link",
"value": "<https://fonts.gstatic.com>; rel=preconnect; crossorigin"
},
{
"name": "x-xss-protection",
"value": "1; mode=block"
},
{
"name": "expires",
"value": "Sun, 14 Apr 2019 21:45:06 GMT"
}
],
"cookies": [],
"content": {
"size": 4498,
"mimeType": "text/css",
"text": "[redacted]"
},
"redirectURL": "",
"headersSize": -1,
"bodySize": -1,
"_transferSize": 854
},
"cache": {},
"timings": {
"blocked": 14.100000000016415,
"dns": 27.329,
"ssl": 46.616,
"connect": 74.052,
"send": 0,
"wait": 10.321999999880063,
"receive": 0.8379999999306165,
"_blocked_queueing": 13.277000000016415
},
"serverIPAddress": "172.217.9.170",
"_initiator": {
"type": "parser",
"url": "https://redacted.netlify.com/",
"lineNumber": 6
},
"_priority": "VeryHigh",
"_resourceType": "stylesheet",
"pageref": "page_4"
},
{
"startedDateTime": "2019-04-14T21:45:06.424Z",
"time": 48.637999999755266,
"request": {
"method": "GET",
"url": "https://fonts.gstatic.com/s/roboto/v19/KFOlCnqEu92Fr1MmWUlfBBc4.woff2",
"httpVersion": "http/2.0+quic/43",
"headers": [
{
"name": "User-Agent",
"value": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"
},
{
"name": "Referer",
"value": "https://fonts.googleapis.com/css?family=Roboto:400,700&subset=latin,latin-ext"
},
{
"name": "Origin",
"value": "https://redacted.netlify.com"
}
],
"queryString": [],
"cookies": [],
"headersSize": -1,
"bodySize": 0
},
"response": {
"status": 200,
"statusText": "",
"httpVersion": "http/2.0+quic/43",
"headers": [
{
"name": "date",
"value": "Mon, 25 Mar 2019 20:21:40 GMT"
},
{
"name": "x-content-type-options",
"value": "nosniff"
},
{
"name": "last-modified",
"value": "Mon, 25 Mar 2019 20:13:46 GMT"
},
{
"name": "server",
"value": "sffe"
},
{
"name": "age",
"value": "1733006"
},
{
"name": "content-type",
"value": "font/woff2"
},
{
"name": "status",
"value": "200"
},
{
"name": "alt-svc",
"value": "quic=\":443\"; ma=2592000; v=\"46,44,43,39\""
},
{
"name": "cache-control",
"value": "public, max-age=31536000"
},
{
"name": "accept-ranges",
"value": "bytes"
},
{
"name": "timing-allow-origin",
"value": "*"
},
{
"name": "access-control-allow-origin",
"value": "*"
},
{
"name": "content-length",
"value": "15816"
},
{
"name": "x-xss-protection",
"value": "1; mode=block"
},
{
"name": "expires",
"value": "Tue, 24 Mar 2020 20:21:40 GMT"
}
],
"cookies": [],
"content": {
"size": 15816,
"mimeType": "font/woff2",
"text": "[redacted]",
"encoding": "base64"
},
"redirectURL": "",
"headersSize": -1,
"bodySize": -1,
"_transferSize": 15920
},
"cache": {},
"timings": {
"blocked": 2.2409999998616694,
"dns": -1,
"ssl": -1,
"connect": -1,
"send": 0.08200000000000002,
"wait": 45.09700000001289,
"receive": 1.2179999998807034,
"_blocked_queueing": 1.9459999998616695
},
"serverIPAddress": "216.58.194.67",
"_initiator": {
"type": "script",
"stack": {
"callFrames": [
{
"functionName": "",
"scriptId": "368",
"url": "chrome-extension://mbigbapnjcgaffohmbkdlecaccepngjd/lib/jquery-ui-1.8.6/js/jquery-1.4.2.js",
"lineNumber": 20,
"columnNumber": 266
},
{
"functionName": "ready",
"scriptId": "368",
"url": "chrome-extension://mbigbapnjcgaffohmbkdlecaccepngjd/lib/jquery-ui-1.8.6/js/jquery-1.4.2.js",
"lineNumber": 10,
"columnNumber": 196
},
{
"functionName": "B",
"scriptId": "368",
"url": "chrome-extension://mbigbapnjcgaffohmbkdlecaccepngjd/lib/jquery-ui-1.8.6/js/jquery-1.4.2.js",
"lineNumber": 17,
"columnNumber": 6
}
]
}
},
"_priority": "VeryHigh",
"_resourceType": "font",
"pageref": "page_4"
},
{
"startedDateTime": "2019-04-14T21:45:06.431Z",
"time": 53.76699999987977,
"request": {
"method": "GET",
"url": "https://fonts.gstatic.com/s/roboto/v19/KFOmCnqEu92Fr1Mu4mxK.woff2",
"httpVersion": "http/2.0+quic/43",
"headers": [
{
"name": "User-Agent",
"value": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"
},
{
"name": "Referer",
"value": "https://fonts.googleapis.com/css?family=Roboto:400,700&subset=latin,latin-ext"
},
{
"name": "Origin",
"value": "https://redacted.netlify.com"
}
],
"queryString": [],
"cookies": [],
"headersSize": -1,
"bodySize": 0
},
"response": {
"status": 200,
"statusText": "",
"httpVersion": "http/2.0+quic/43",
"headers": [
{
"name": "date",
"value": "Mon, 25 Mar 2019 20:21:59 GMT"
},
{
"name": "x-content-type-options",
"value": "nosniff"
},
{
"name": "last-modified",
"value": "Mon, 25 Mar 2019 20:12:01 GMT"
},
{
"name": "server",
"value": "sffe"
},
{
"name": "age",
"value": "1732987"
},
{
"name": "content-type",
"value": "font/woff2"
},
{
"name": "status",
"value": "200"
},
{
"name": "alt-svc",
"value": "quic=\":443\"; ma=2592000; v=\"46,44,43,39\""
},
{
"name": "cache-control",
"value": "public, max-age=31536000"
},
{
"name": "accept-ranges",
"value": "bytes"
},
{
"name": "timing-allow-origin",
"value": "*"
},
{
"name": "access-control-allow-origin",
"value": "*"
},
{
"name": "content-length",
"value": "15736"
},
{
"name": "x-xss-protection",
"value": "1; mode=block"
},
{
"name": "expires",
"value": "Tue, 24 Mar 2020 20:21:59 GMT"
}
],
"cookies": [],
"content": {
"size": 15736,
"mimeType": "font/woff2",
"text": "[redacted]",
"encoding": "base64"
},
"redirectURL": "",
"headersSize": -1,
"bodySize": -1,
"_transferSize": 15840
},
"cache": {},
"timings": {
"blocked": 4.55399999966129,
"dns": -1,
"ssl": -1,
"connect": -1,
"send": 0.15599999999999992,
"wait": 39.65100000009211,
"receive": 9.406000000126369,
"_blocked_queueing": 3.0159999996612896
},
"serverIPAddress": "216.58.194.67",
"_initiator": {
"type": "script",
"stack": {
"callFrames": [
{
"functionName": "",
"scriptId": "368",
"url": "chrome-extension://mbigbapnjcgaffohmbkdlecaccepngjd/lib/jquery-ui-1.8.6/js/jquery-1.4.2.js",
"lineNumber": 20,
"columnNumber": 266
},
{
"functionName": "ready",
"scriptId": "368",
"url": "chrome-extension://mbigbapnjcgaffohmbkdlecaccepngjd/lib/jquery-ui-1.8.6/js/jquery-1.4.2.js",
"lineNumber": 10,
"columnNumber": 196
},
{
"functionName": "B",
"scriptId": "368",
"url": "chrome-extension://mbigbapnjcgaffohmbkdlecaccepngjd/lib/jquery-ui-1.8.6/js/jquery-1.4.2.js",
"lineNumber": 17,
"columnNumber": 6
}
]
}
},
"_priority": "VeryHigh",
"_resourceType": "font",
"pageref": "page_4"
}
]
}
}
答案 0 :(得分:1)
tl; dr:确保您的输入名称属性都是唯一的。否则提交将无提示失败。
将其发布为答案,以帮助遇到此问题的任何其他人。事实证明,某些格式错误(在这种情况下,输入的名称重复)似乎可以成功提交,但实际上要么发送到垃圾邮件,要么丢失。
为确认起见,我创建了一个新表单,该表单与第一个表单相同,但所有输入均正确命名。表单提交正常,并立即显示在仪表板中。
然后,在这种情况下,我将最后一个输入更改为另一个输入“电子邮件”已经使用的名称。提交似乎很成功,但是数据从未显示在仪表板上。
将名称更改回唯一名称,然后再次尝试成功提交并立即显示在仪表板中。
这就是我的错误。
<div class="registration-form">
<label for="email">E-mail Address:</label><input type="email" id="email" name="email" required minlength="4" maxlength="128">
</div>
...
<div class="registration-form">
<input type="number" id="number" name="email" required minlength="1" maxlength="4" size="4" class="number"> <label for="people">Number of people expected?</label>
</div>
答案 1 :(得分:0)
我在使用Netlify表单时遇到了类似的问题-显示为成功,但是实际上并没有提交。您可以尝试将data-netlify="true"
切换为netlify
吗?这为我解决了这个问题。