How could I link a checkbox from HTML into java script ? I have built the checkbox in HMTL like so :
<label><b>Response Needed ?</b></label>
<input id="Check" type="checkbox" >
When I hit the submit button I need the value to be T (true) or F (false) if its checked or not..
I usually use getElementById("") to link things into Javascirpt but cant get this to work!
EDIT: Here is my full Document so you can see how its works :
`
<!DOCTYPE HTML>
<html>
<head lang="en">
<meta charset="UTF-8">
</head>
<body>
<form id="OTA">
<label><b>IMEI:</b></label>
<input type="text" name="ID" id="IMEI" maxlength="15">
<label><b>AT Command:</b></label>
<input id="Command" type="text">
<label><b>Response Needed ?</b></label>
<input id="Check" type="checkbox" >
</form>
<input type="submit" value="Submit" onclick="showInput();"><br />
<p><span id='display'></span> </p>
<script language="JavaScript">
function showInput() {
var message_entered = ">RSP=" + document.getElementById("Check").checked + ";ID=" + document.getElementById("IMEI").value + ";" + document.getElementById("Command").value + "<";
document.getElementById('display').innerHTML = message_entered;
}
</script>
</body>
</html>
I need to change the values of the checkbox to T and F when checked or not. Cheers