Hello,
I am trying to filter a report using the option of data-driven html form, but I can't return the selected value of the buttons in the report, the buttons are created in the html form.
Below is the code i use:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="text/javascript" src="../util/messagingUtil.js"></script>
<script type="text/javascript" src="./util/contentUtil.js"></script>
<title>SAS</title>
</head>
<body>
<h1>HTML DOM Events</h1>
<h2>The onclick Event</h2>
<p>Select one the following choices:</p>
<div id="buttons">
<button id="option1" onclick="selectOption('A')">A</button>
<button id="option2" onclick="selectOption('B')">B</button>
</div>
<div id="result">
<p> </p>
<p> </p>
</div>
<script>
function selectOption(text) {
let selectedText;
var selection=[];
var vaResultName;
selectedText = text;
document.getElementById("result").innerHTML = selectedText;
selection.push(selectedText){
return test == selectedText
}));
va.messagingUtil.postSelectionMessage(vaResultName, selection);
x.innerHTML= "Your selection is " + test;
}
</script>
</body>
</html>
What needs to change to return my variable to the report?
Thanks,
Charis