Problem with @clear after user input a name, returns boolean instead of value

Hi guys, I am kinda new on this and trying to figure this out.
I started to test some things and I got here where I want a user to input a name for example and read it's value after, but instead reading it's value I only got a boolean value.

Here is the example:

[[first]]:

What is your name?
<textarea id="nameInput"></textarea>

[[Go to second]](second)

[[second]]:
@clear
    squiffy.set("name", jQuery("#nameInput").val());


Your name is, {name}.

the result:

Your name is, true.

What I miss? Thank you in advance.

PS: I found out that @clear value it clears all not only the screen, but it is required to clear only the screen...
Regards, Daniel


Your second section there does the following:

  1. Clear the screen
  2. Search the screen for an input named 'nameInput' and set an attribute to its contents.

You're looking for a form that's already been removed. It seems that squiffy.set converts the value undefined to true, though I'm not sure why.

If you want to clear the screen after reading the value from the screen, you'll need to use javascript. Like this:

[[first]]:

What is your name?
<input type="text" id="nameInput"/>

[[Go to second]](second)

[[second]]:
    squiffy.set("name", jQuery("#nameInput").val());
    squiffy.ui.clearScreen();

Your name is {name}.

(I also changed the input type from a textarea to an input while I was testing it. They work the same; the only real difference is that a textarea is designed for allowing multiple lines)


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

Support

Forums