why is this html does not shows the "logout button ? how to fix it ?
Chapter7: User Creation And Management
Section: Chapter Questions
Problem 1HOA
Related questions
Question
100%
why is this html does not shows the "logout button ? how to fix it ?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login</title>
<style>
form{
display: flex;
flex-direction: column;
width: 300px;
justify-content: space-evenly;
margin: auto;
}
h1{
position: fixed;
width: 150px;
height: 100px;
top: 20%;
right: 20%;
margin-top: -150px;
margin-left: -175px;
background: #3907c3;
}
h2{
position: fixed;
width: 350px;
height: 300px;
top: 50%;
left: 50%;
margin-top: -150px;
margin-left: -175px;
background: #07A8C3;
padding-top: 10px;
}
div {
position: fixed;
background: green;
width: 250px;
height: 200px;
top: 50%;
left: 50%;
margin-top: -100px;
margin-left: -155px;
padding-top: 100px;
padding-left: 60px;
}
</style>
<script type="application/javascript">
function validate() {
{{!-- var data = new FormData(); --}}
const data = new URLSearchParams();
data.append('name', document.getElementById("name").value);
data.append("password", document.getElementById("password").value);
var params = { name: document.getElementById("name").value, password: document.getElementById("password").value };
var request = new XMLHttpRequest();
request.open("POST", "/api/login");
request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
request.onload = function () {
var result = JSON.parse(request.response);
if (result.status === "y") {
window.location.href = "/index";
} else {
alert(result.meg);
}
};
{{!-- request.send(JSON.stringify(params)); --}}
request.send(data.toString());
}
<h1>quit</h1>
<div style="width:250px;height:550px;border:1px solid black;float:left"></div>
<form method="POST" action="/quittolanding"></form>
<button id="quittolanding">quittolanding</label>
</form>
</section>
</script>
<h2>Login</h2>
<form action="index.hbs" method="POST" >
<div>
<label for="" >User Name:</label>
<li class="list-group-item"><input class="form-control" type="text" name="name" id="name" placeholder="enter account" /></li>
<li class="list-group-item"><input class="form-control" type="text" name="password" id="password" placeholder="enter password" /></li>
<li class="list-group-item"><button type="button" class="btn btn-block btn-danger" onclick="validate()" id="btnLogin">login</button></li>
</ul>
</div>
</body>
</html>
=============================
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
A+ Guide To It Technical Support
Computer Science
ISBN:
9780357108291
Author:
ANDREWS, Jean.
Publisher:
Cengage,
Enhanced Discovering Computers 2017 (Shelly Cashm…
Computer Science
ISBN:
9781305657458
Author:
Misty E. Vermaat, Susan L. Sebok, Steven M. Freund, Mark Frydenberg, Jennifer T. Campbell
Publisher:
Cengage Learning
A+ Guide To It Technical Support
Computer Science
ISBN:
9780357108291
Author:
ANDREWS, Jean.
Publisher:
Cengage,
Enhanced Discovering Computers 2017 (Shelly Cashm…
Computer Science
ISBN:
9781305657458
Author:
Misty E. Vermaat, Susan L. Sebok, Steven M. Freund, Mark Frydenberg, Jennifer T. Campbell
Publisher:
Cengage Learning
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning