atcheck/lsscanner/new/addstudent.html

43 lines
1.3 KiB
HTML
Raw Normal View History

2019-11-24 19:02:22 +01:00
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/css/materialize.min.css">
<meta charset="UTF-8">
<title>Add student</title>
</head>
<body>
<div class="container">
<form>
<div>
<h5 class="center">Enter student data</h3> <br />
Name: <input type="text" id="name" required autofocus/> <br />
Surname: <input type="text" id="surname" required autofocus/> <br />
Index: <input type="text" id="index" required autofocus/> <br />
</div>
<br />
<button class="btn waves-effect waves-light" type="submit">Add</button>
</form>
</div>
<script>
const electron = require('electron');
const {ipcRenderer} = electron;
const form = document.querySelector("form");
form.addEventListener("submit",submitForm);
function submitForm(e){
e.preventDefault();
var name = document.querySelector("#name").value;
var surname = document.querySelector("#surname").value;
var index = document.querySelector("#index").value;
const item = [name,surname,index];
ipcRenderer.send("item:add",item);
}
</script>
</body>
</html>