-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html.save
More file actions
50 lines (42 loc) · 1.19 KB
/
index.html.save
File metadata and controls
50 lines (42 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<html>
<head>
</head>
<body>
<form id="startStop" action="simulator2.php" method="POST">
ID do medidor: <input type="text" name="meter_id"><br>
<input id="start" type="submit" onClick="begin();" value="Iniciar">
<input name="stop" type="submit" onClick="end();" value="Parar">
</form>
<?php
if($_POST){
echo (.$_POST['meter_id']);
}
?>
</body>
<script type="text/javascript" language="javascript">
var myVar;
function begin()
{
//myVar=setTimeout(function(){alert("Hello")},3000);
///var meter_id = document.getElementById("meter_id");
$('#start').click(function(){
var dados = $('#startStop').serialize();
$.ajax({
type: 'POST',
dataType: 'json',
url: 'simulador2.php',
async: true,
data: dados,
sucess: function(response) {
location.reload();
}
});
return false;
});
}
function end()
{
clearTimeout(myVar);
}
</script>
</html>