Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Placing a text form into a variable

I created a text box form in one of my Twine passages using HTML5 syntax. It looks like this:

<input type="text" name="your name" size="30">

How can I place user's input text into a variable?
The following construction with parentheses doesn't work:
(set: $yourName to (<input type="text" name="your name" size="30">))

I don't want to use any pop-up windows with a 'prompt:' command, just a simple text box form.

Please help me!

Comments

  • You need to state which Story Format you are using when you ask a question, as answers can be different for each one. Based on the format of your set macro I am going to assume you are using Harlowe.

    This comment in the Allowing users to input correct answers in HTML Text Box thread explains one way to use Javascript to implement what you want.
  • edited July 2016
    Thank you very much for the link to Csalzman's code. Using this code in Harlowe format with minor adjustments for my text box form does really solve the issue. Also, I am going to try the other variations suggested on that page.
Sign In or Register to comment.