i'm playing with appcreator (https://appcreator24.com) and designing an app from scratch.
I want it to have a "login" screen, where really the only thing that will be used is a password. example: 0101. I am using Bootstrap for layout:
<form>
<div class="form-group">
<label for="exampleInputEmail1"><i class="fa fa-user"></i> Usr</label>
<input class="form-control" type="text" placeholder="uussrr" readonly>
<small id="emailHelp" class="form-text text-muted">Same -- all.</small>
</div>
<div class="form-group">
<label for="exampleInputPassword1"><i class="fa fa-key"></i> Contraseña</label>
<input type="password" id="pswd" class="form-control" id="exampleInputPassword1">
<input type="checkbox" onclick="myFunction()"> <i class="fa fa-eye"></i> Mostrar
</div>
<button style="margin-right: -6px;" type="button" value="Submit" onclick="checkPswd()" class="btn btn-outline-primary"><i style="margin-left: -8px; margin-right: 3px;" class="fa fa-sign-in-alt"></i> Entrar</button>
</form>
And to check the password:
<script type="text/javascript">
function checkPswd() {
var confirmPassword = "0101";
var password = document.getElementById("pswd").value;
if (password == confirmPassword) {
window.location="go:home";
}
else{
alert('Wrong.');
}
}
//Show Password
function myFunction() {
var x = document.getElementById("pswd");
if (x.type === "password") {
x.type = "text";
} else {
x.type = "password";
}
}
</script>
I know that it is not the best way to use the password, but it does not matter because it is not an app where you will have a database or sensitive information.
What i want to know is, how can the user "save his ip" so that the application does not ask him to enter the password every time he starts it?