Question

I'm trying to build an HTA app with a textarea box with pre-defined text:

<textarea name="Box1" rows=3 cols=75>Use this area for inputs that require multiple lines of text. 
This is an example of pre-defined text.</textarea>

Which works. However, I'm also adding a reset button that clears some of the input boxes and textareas:

 Sub ResetSub
 Value5.Focus
 Value5.Value = "Reset successful"
 Box1.Value = "Use this area for inputs that require multiple lines of text. 
This is an example of pre-defined text."
    End Sub
<input id=runbutton  type="button" value="Reset" onClick="ResetSub">

Loading the HTA I get an "Unterminated string constant" error because Box1.Value doesn't have quotes at the end of the line. Does anyone know how I can fix this? NOTE: I can't reload the entire page because I also need to retain data from other text boxes. Thanks for the tips!

Was it helpful?

Solution

You can include a newline like so:

Box1.Value = "Use this area for inputs that require multiple lines of text." & chr(13) & "This is an example of pre-defined text."
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top