Your second function getRadValue()
isn't being called anywhere. Set it up:
<input type="checkbox" style="border:none;" name="luggage_van" id="luggage_van" onClick="getRadValue();" >
Fix your typo (glovalvariable vs globalvariable):
function getRadValue() {
var name = document.getElementById('demo').value = globalvariable;
alert(name);
}
Now when you click on the checkbox, you'll get an alert of your globalvariable
.
Check for the existence of id
in your first function:
function calculateTotal(id) {
if (id) {
globalvariable=document.getElementById('demo').value = id;
}
alert(globalvariable);
}