How do I load a .txt file into a textbox and make the textbox readonly?

I’m trying to create essentially a EULA page.

I want to load a preexisting text file into it a textbox and I want to make the textbox read only.

Is this possible in p5.js?

Thanks in advance.

One way to do this is with a separate small JavaScript, not in the p5.js sketch.

if you want it controlled from within the sketch, you could also use p5.dom.

Use a dom call to make a standard html+css form in a div visible on the page. The sketch makes the div visible. Then, on the form submit action, the div becomes hidden again.

what about loading the file on preload(), and then using the function createP() ?

1 Like

This is all more complicated than I would like.
I think I’ll just use images of the text instead.
Thanks though.