Help with <<textbox>> input on Twine Sugarcube

Twine Version: 2.5.1
Story Format: Sugarcube 2.36.1

I’m trying to make it so that you have to call a certain phone number, and if you input it wrong you misdial and have to put it in correctly to move forwards. I’m not getting any errors, but when I press the dial number button it doesn’t do anything, no matter what the input.

You pick up the phone, and dial Tomas's number... <<textbox "$tomasNum" "" autofocus>><<button "Dial Number">>
	<<if $tomasNum is "+49 123-456-7890">>
		The phone starts to ring.
		[[Wait for an answer]]
    <<else>>
    	You misdialed Tomas's number, maybe recheck his file.
	<</if>>
<</button>> 

[[Reread Tomas's File]]

You’d need to use the macro <<replace>> to show the text. You can find it in the documentation: here

You pick up the phone, and dial Tomas's number... <<textbox "$tomasNum" "" autofocus>>
<span id="test"></span>
<<button "Dial Number">>
	<<if $tomasNum is "+49 123-456-7890">>
		<<replace "#test">>The phone starts to ring.
		[[Wait for an answer]]<</replace>>
    <<else>>
    	<<replace "#test">>You misdialed Tomas's number, maybe recheck his file.<</replace>>
	<</if>>
<</button>> 

[[Reread Tomas's File]]
1 Like

Thank you so much! I really appreciate it. I’m new to Twine.

1 Like