Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

Can a default value be set with customScripts.updateNamedHook user input method?

$
0
0
This routine works fine, but I would like to pre-set the values.
if (typeof window.customScripts == "undefined") {
	window.customScripts = {
		updateNamedHook: function(hookName) {
			var value = $("input[name='" + hookName + "'], textarea[name='" + hookName + "']")[0].value;
			// Find the named hook node and set the text inside.
			$("tw-hook[name*='" + hookName + "']").text(value);
		}
	}; 
};

and in the passage I use the standard code
[]<Answer1|. <input type="text" name="Answer1" value="">

My screen has a menu of input fields using the above Javascript, then I progress to the next passage, which prints a report based on the inputs.

I would like to back up to the input screen and change one or more fields and then reprint.
But of course all the fields are blank and have to be re-entered

I tried
<Answer1|. <input type="text" name="Answer1" value=$Value1>

But that just pre-sets the data field with the literal "$Value1" rather than its contents

Viewing all articles
Browse latest Browse all 1844

Trending Articles