@clear interferes with text input

I have something like this:

[[choose_name]]:
@clear

    setTimeout(function(){
        $("#continue").click(function(){
            squiffy.story.go("next_section");
	    });
    },10);

You are called ...

<input type="text" id="name_id" maxlength="12"><br>

<button id="continue">Continue</button><br>

[[next_section]]:
@clear

    squiffy.set("name", jQuery("#name_id").val());

{name}... now that's a good name for an adventurer!

As it is, when I go to the [[next_section]] the {name} is always the word "true", instead of the actual name that I wrote in the previous section's text area. However, when I remove the @clear from the [[next_section]] the problem disappears. Is there any solution to make them work together as I intended? (@clear and the text input)


You can move the

squiffy.set("name", jQuery("#name_id").val());

to

setTimeout(function(){
    $("#continue").click(function(){
        squiffy.set("name", jQuery("#name_id").val());
        squiffy.story.go("next_section");
    });
},10);

Thank you, manowar!


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums