Can php do this?

So I have some checkboxes on my form and if it is checked I want to let the user give a small description of it as well ie. show a textinput for them to be able to write in....

I'm thinking either when the checkbox is true it could somehow dynamically create a textinput (hmmm not sure if I've seen this...)

OR

I could have disabled textinputs next to the checkboxes and clicking on a checkbox will enable the textinput next to it?

Are there any [better] methods and if not which should I go for and how? Thx