How to Send variables to Captivate from HTML using Javascript
Hey,
I inserted in my Captivate Project a slider object as Html web. I want to send and store the value of some Variables that are in my html page to the user varibales in my Captivate project. so that I can display them on the Project. Any help to cannect html js to my captivate js ?
//my html code
<!DOCTYPE html>
<html lang="en-us">
<head>
<style>
#main {
border-radius: 20px;
background: #BCBABA;
padding: 10px;
width: 600px;
height: auto;
}
</style>
<script language="javascript">
// Captivate is get the values from presents and homeOffice
var lPresents; // variable presents
var lHomeOffice; // variable homeOffice
var presentsOutput;
var homeOfficeOutput;
parent.iFrameSlider = window; // iFrameSlider defined in JS in Captivate
function initSliders() {
var lPresents = document.getElementById("presents");
var lHomeOffice = document.getElementById("homeOffice");
presentsOutput = document.getElementById("showPresents");
homeOfficeOutput = document.getElementById("showHomeOffice");
lPresents.addEventListener("input", function() {
presentsOutput.value = this.value;
}, false);
lHomeOffice.addEventListener("input", function() {
homeOfficeOutput.value = this.value;
}, false);
}
</script>
<meta charset="utf-8">
<title>50/50 Regelung</title>
</head>
<body onload="initSliders()">
<div id="main">
<table width="100%^"border="0"cellpadding="4">
<tbody>
<tr>
<td width="19%" align="right">Praesenzarbeit:</td>
<td width="72%"><input type="range" max="21" min="0" id="presents" value ="2" style="width:400px"></td>
<td width="9%"><output for="presents" id="showPresents">5</output></td>
</tr>
<tr>
<td width="19%" align="right">Home office:</td>
<td width="72%"><input type="range" max="21" min="0" id="homeOffice" value ="2" style="width:400px"></td>
<td width="9%"><output for="homeOffice" id="showHomeOffice">5</output></td>
</tr>
</tbody>
</div>
</table>
</body>
</html>So i want exactly to store value of the html element/variable "lPresents" in the user Variable in Captivate "hzdTotalPresent". Eny suggestion ?


