Using javascript how to I take the text value of a radiobutton/checkbox and transfer it to another slide?

Nov 14, 2016

Using javascript how to I take the text value of a radiobutton/checkbox and transfer it to another slide?

For example, I need a trigger that whenever someone clicks on a radio button, the value/text of that option gets displayed on a different slide.

Thanks! 

1 Reply
Brian Ochieng

Hi Matthew. I have a question. I would like to capture data from multiple response questions and print it to a html file using Javascript. The code below only captures input fields. Can you give some insights

var player = GetPlayer();
var textEntry1=player.GetVar("TextEntryWP1_1");
var textEntry2=player.GetVar("TextEntryWP1_2");
var textEntry3=player.GetVar("TextEntryWP1_3");
var textEntry4=player.GetVar("TextEntryWP1_4");
var textEntry5=player.GetVar("TextEntryWP1_5");

// Step 2. The HTML Section - with the Storyline variables inserted
var contents = "<html><head></head><body style='width:650px;padding:20px;'>";
contents+="<div style='font-size:26px;font-weight:bold;margin-top:26px;margin-bottom:20px;'>Technical Mission Report for WP1</div>";
contents+="<div style='display:block;border-width:1px';><hr/></div>";
contents+="<div style='font-size:16px;font-weight:bold;'>WP and Coordinates</div>";
contents+="<p>"+textEntry1+"</p>";
contents+="<div style='font-size:16px;font-weight:bold;'>Observations</div>";
contents+="<p>"+textEntry2+"</p>";
contents+="<div style='font-size:16px;font-weight:bold;'>Interpretation</div>";
contents+="<p>"+textEntry3+"</p>";
contents+="<div style='font-size:16px;font-weight:bold;'>Questions</div>";
contents+="<p>"+textEntry4+"</p>";
contents+="<div style='font-size:16px;font-weight:bold;'>Techniques</div>";
contents+="<p>"+textEntry5+"</p>";
contents+= "</body></html>";

// Step 3. Open the document window, write the HTML contents, and open the print window
var myWindow = window.open("","Print","width=810,height=610,scrollbars=1,resizable=1");
myWindow.document.write(contents);