I have been working on this auto-login feature for my website. This feature includes an automatically sent form, created and submitted through pure javascript. When I try to send the form though, it gives me the error
Form submission canceled because the form is not connected
This is my code that's sending the form:
var method = "post";
var path = "cookie.php";
var form = document.createElement("form")
form.setAttribute("method",method);
form.setAttribute("path",path)
var hiddenform = document.createElement("input")
hiddenform.setAttribute("type","hidden")
hiddenform.setAttribute("id","hiddeninputusername")
hiddenform.setAttribute("value",cookieusername)
form.appendChild(hiddenform);
var hiddenforms = document.createElement("input")
hiddenforms.setAttribute("type","hidden")
hiddenforms.setAttribute("id","hiddeninputusername")
hiddenforms.setAttribute("value",cookiepassword)
form.appendChild(hiddenforms)
form.submit()
Note:This question is not a duplicate of the others because it is pure javascript