Please use the Question Tags to state the name and full version number of the Story Format you are using, as answers can vary based on this information.
Neither series of Harlowe (1.x or 2.x) comes with a built-in TextBox (or TextArea) so you are going to have to use code to abuse or hack the relevant story format's engine to achieve the result you want.
If you are using Harlowe 1.x then Allowing users to input correct answers in HTML Text Box thread on the Old Forum Archive contains information on how to abuse the story format's existing functionality do what you want..
why isn't there such a code in harlowe format
Because it's developer hasn't decided to add it, so if you want such a feature then I strongly suggest you add a request for one on the Issues page of the story format's repository.
made it work in sugarcube, then i noticed that all the variables was showing and none of them were working
Could you explain in more detail what you meant by the "none of them were working" part of the above statement, so we can determine if there is a bug in that story format or if it was just a misunderstanding of how things work.