-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWebApp.js
32 lines (28 loc) · 962 Bytes
/
WebApp.js
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
var distance;
var current;
var remaining
function distFunc()
{
var distance = document.getElementsByName('distance').value;
var current = document.getElementsByName('current').value;
var remaining = var distance - var current;
if(distance < 0)
{
distance.onSubmit console.log(remaining);
}
}
function checkNegativeValue()
{
var distance = parseFloat(document.getElementByName("distance").value);
if(distance < 0)
{
distance.onSubmit alert("Negative Value is not allowed");
return false;
}
}
if(distance > 0)
{
var name = document.getElementById('distance').value;
console.log(distFunc());
}
document.getElementByName("output").value;