You could combine the hypothetical information found in the A way to have a text box on the page rather than an input box question with the information found in points 2 & 3 in the Any way to bind keyboard inputs to links... question to create a updateVariable() function that simulated the clicking of a (hidden) link once the other code had been executed.
1. Add the required links to the same passage as containing your input elements.
note: each link would need to be wrapped in it's own uniquely named hook.
|next>[ [[Use the Save button to visit the Next passage.|Next]]]
2. Use CSS (based on the hook names) in your Story Stylesheet area to hide each of the links.
tw-hook[name="next"] {
display: none;
}
3. Modify the existing updateVariable() function (or create a new function) to click the hidden link.
updateVariable(inputName) {
/* The exisiting code of updateVariable function... */
/* Check the value entered and click the link if it exists. */
if (value == "correct value") {
var link = $('tw-hook[name="next"] tw-link');
if (link.length > 0) {
link.click();
}
}
}
WARNING: If you are using JavaScript to modify the contents of the undocumented State.variables object and if that contents is a collection object of some kind (Array, Map, etc) then it is likely that you are corrupting History, which can effect the outcome of the Undo feature if more than a single passage traversal has occurred since the last TwineScript modification of the same collection.