I need to return the result of submitting a form to a popup (I tried lightbox but I can not use it, would it be better?) in the center of the user's screen, the only problem is that the popup is returning a page blank and I could not identify where the error is in the code.
If I put 'include / verify.php' in the window.open it gives several error messages, it does not resolve.
Form:
<form action="include/verifica.php" onsubmit="return abrirPopup('this', 400, 120)" method="POST">
JS:
function abrirPopup(form, w, h) {
var newW = w + 100;
var newH = h + 100;
var left = (screen.width - newW) / 2;
var top = (screen.height - newH) / 2;
var newwindow = window.open('', 'formpopup', 'width=' + newW + ',height=' + newH + ',left=' + left + ',top=' + top);
form.target = 'formpopup';
newwindow.resizeTo(newW, newH);
//posiciona o popup no centro da tela
newwindow.moveTo(left, top);
newwindow.focus();
return false;
}
The form is in my index, it checks if all the data has been entered in the verify.php in case it includes the insere.php which is the one who throws the data to the database and returns me a protocol number, which is the id of the new line in the table.
I'm sorry for the code mess but this is mostly because of the number of times I've changed it in the desperation of trying to fix haha