The code that ran normally in Chrome before, and the report submission error after Chrome was upgraded to 56:
Form submission canceled because the form is not connected
code show as below:
function submitData(name) { var form = $('<form method="post" action="updateName">' +'<input type="submit"/>' +'<input type="hidden" name="name" value="'+ name +'" /></form>'); $('input[type="submit"]', form).click(); }
problem solved
the reason
The HTML standard stipulates that if the form is not added to the document, the form submission will be terminated.
Reference: Form submission algorithm
The version before Chrome56 is not compliant with the standard. Chrome56 fixes this problem and makes the form submission meet the standard requirements:
Reference: Chrome issue 2416033002
Solution
The solution is to add the form to the document before submitting:
jQuery
$(document).append(form);
or
document.body.appendChild(form);
Read More:
- Element Error when await is used in UI form submission [Solved]
- [Solved] Error: Message failed: 554 5.2.0 STOREDRV.Submission.Exception:OutboundSpamException;
- Angular Error: No value accessor for form control with name ‘xxx’
- [Solved] Chrome Error: The request client is not a secure context
- Resolve Chromedriver’s original error: chrome not reachable
- [Solved] Error–dubbo Connect zk Error: zookeeper not connected
- How to Solve Chrome Error: net::ERR_FAILED
- [Cadence Allegro PCB Design] error: Possible pin type conflict GND/VCC Power Connected to Output
- How to Solve Chrome error: ERR_CACHE_READ_FAILURE
- Abnormal [System.InvalidOperationException: custom type mapping for ‘xxx’ is not specified or is not a solution
- Chrome Error: Uncaught Error: SECURITY_ERR: DOM Exception 18
- AUC Error – ValueError: Data is not binary and pos_label is not specified
- Solve chrome running error unknown error: cannot get automation extension
- Readiness probe failed: calico/node is not ready: BIRD is not ready: Error querying BIRD: unable to
- GPG error:http://dl.google.com/linux/chrome/deb stable InRelease
- [Solved] webrtc Compile Error: ERROR: The installation of the Chrome OS default fonts failed.
- How to Solve Chrome Error: “ERR_HTTP2_PROTOCOL_ERROR”
- How to Solve jQuery error: Uncaught ReferenceError: $ is not defined
- The browser is compatible with IE11 “ReferenceError: ‘Promise’ is not defined” “ReferenceError: ‘Promise’ is not defined”
- mainfest Image Error: (img/icons/andriod-chrome-192×192.png)Download error or resource isn’t a vaild image