i want to fix a hbs code called "index.hbs " it should with a textbox called Account Number 2 radio buttons: Balance and Deposit ,and a Submitbotton on the right corner, shows the username , put mouse on it will shows "logout: click logout will go back to the login page . index.hbs Bank BANK Menu Submit
i want to fix a hbs code called "index.hbs " it should with a textbox called Account Number 2 radio buttons: Balance and Deposit ,and a Submitbotton on the right corner, shows the username , put mouse on it will shows "logout: click logout will go back to the login page . index.hbs Bank BANK Menu Submit
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
100%
i want to fix a hbs code called "index.hbs "
it should with
a textbox called Account Number
2 radio buttons: Balance and Deposit ,and a Submitbotton
on the right corner, shows the username , put mouse on it will shows "logout: click logout will go back to the login page .
index.hbs
<title> Bank</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./data/d.css">
<scriptsrc="./data/b.js."></script>
</head>
<article class="clscontainer">
<h6 class="main ">BANK</h6>
</article>
<nav class="classsmenu">
<h3>Menu</h3>
<button class="clssubmit" type="submit">Submit</button>
</form>
</body></html>
login .hbs
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>login</title>
<link rel="stylesheet" href="./data/1.css">
<scriptsrc="./data/1.js"></script>
<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());
}
</script>
</head>
<body class="container">
<div class="row">
<div class="col-12">
<ul class="list-group">
<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>
</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 2 steps
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education