I made a database for accounts login for a web app with back4app, it works on Firefox-ish but doesn't work on Chrome at all. on FF, I try to log in and it gives me a parse error 200 username/password required, I reload the page and it works (I don't know why it does that btw and I want to fix that too). The same trick however doesn't work on Chrome, whenever I reload it just clears the fields and doesn't let me in. I looked up the error, and it turns out that the post request doesn't take the info from the input fields for some reason. Here's the login window's HTML:
<dialog id="login">
<h1>تسجيل دخول</h1>
<input type="text" id="loginid" placeholder="id" pattern="[A-Za-z]">
<input type="password" id="loginpass" placeholder="password">
<button type="submit" id="loginButton">دخول</button>
</dialog>
and that's the JS behind it, it's vanilla by the way
const login = document.querySelector('#login');
let loginid = document.querySelector('#loginid').value;
let loginpass=document.querySelector('#loginpass');
const loginButton = document.querySelector('#loginButton');
login.style.display='block';
loginButton.onclick = function() {
let user=Parse.User.logIn(loginid,loginpass.value).then(function(user){
alert(`Welcome ${user.get('username')}`);
login.style.display='none';
membersDiv.style.display='block';
addMemberArea.style.display='block';
}).catch(function(error){
alert(error);
})
}