I have 2 scenes, where the first one displays the input textbox and the submit button. So when i type in the text, and click submit, it will go straight to the next scene, and there, it displays the text I’ve typed.
i have tried inputting the hypeDocument.getElementById().value / innerHTML in the javascript section.
But the submit button need to submit the value AND go to the next scene. I cannot achieve this part.
may i know how to code this thing properly? The submit button would not go to the next scene even i have put it under Mouse Click.
Put this script in the “On Scene Load” option of the Scene Inspector of Scene 2. The input field in Scene 1 needs an id of ‘name’ and the next scene needs a text box with an id of ‘fromS1’.
var txt1 = hypeDocument.getElementById('name').value; //gets from scene 1
hypeDocument.getElementById('fromS1').innerHTML = txt1; //puts in scene 2
PS: I am not using a form ‘Submit’ button, just a standard Hype button to go to the next scene.
I habe a Project, where it is necessary, that the input-field in the first scene hold his value. How can it work. The project will`ve more then 10 scenes. And all scenes have input-fields. And the user can switch from scene to scene. If the fields lost there value, the project will be crashed. Have you a simple solution?
You save my day and my project. Thank you so much. Your idea brings the solution for me. But not exactly in this way. My input-field look like that:
input type=text" id=“name” value=""
Then, in the next step, i set the input-field as a persistent symbol with the choice “add to the current scene”.