Created
September 29, 2015 16:03
-
-
Save danspndl/a5ca14fd43926ffff7c6 to your computer and use it in GitHub Desktop.
Obtaining form values
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Obtaining form values</title> | |
<meta charset="UTF-8"> | |
</head> | |
<body> | |
<form action="" id="input" > | |
<p> | |
<label for='a'>a=</label> | |
<input type="text" id="aSide" name="a" value="1" /> | |
</p> | |
<p> | |
<label for='b'>b=</label> | |
<input type="text" id="b" name="b" value="1" /> | |
</p> | |
<p> | |
<label for='c'>c=</label> | |
<input type="text" id="c" name="c" value="1" /> | |
</p> | |
<input type="button" onclick="send()" value="Submit"> | |
</form> | |
<script> | |
function send() { | |
// Obtaining form values | |
var a = input.elements["a"].value; | |
var b = input.elements["b"].value; | |
var c = input.elements["c"].value; | |
// Debug | |
console.log("a= "+a); | |
console.log("b= "+b); | |
console.log("c= "+c); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment