How to create textbox at runtime?

I want to make something like at start of doctype it should ask “How many textbox you want?” then depending on the input number of textbox should be created at runtime.How can i do that?

Hi can you explain the use of this?

Actually i was working on co(course outcome) and po(program outcome) module of college. but thing is course outcome can be change every year like this year there was five course outcome then next year there can be six course outcome. so how to manage this dynamic thing in the project.