Update:
You've added a comment to your question:
my objective is newly created page should also be saved on the server at the time of creation
That completely changes your question. To create a file on the server, you'll have to involve a server-side language (which could be JavaScript, via NodeJS or Rhino or several other projects) as well as JavaScript on the client. You'll need to post the user's choice to the server and generate the file there.
Original answer: (Prior to the comment above)
Yes, you can do that. You can either show them a page where they make these choices and then replace that page's content with what they asked for, or you can open a new window and show their selection there.
In either case, you'd probably use the DOM:
...and/or a good JavaScript library like jQuery, Prototype, YUI, Closure, or any of several others to help smooth over browser differences and provide significant utility functionality.
Here's a really minimalist example using only DOM and JavaScript (no libraries, but I do strongly recommend using one, the code would be leaner and more robust):
Live copy | Live source
HTML:
<div id="question">
<label>How many text boxes would you like?
<select id="numboxes">
<option value="1">One</option>
<option value="2">Two</option>
<option value="3" selected>Three</option>
</select></label>
<input type="button" id="btnGo" value="Go">
</div>
JavaScript:
(function() {
document.getElementById("btnGo").onclick = genPage;
function genPage() {
var sel = document.getElementById("numboxes"),
num = parseInt(sel.options[sel.selectedIndex].value, 10),
counter,
box;
document.getElementById("btnGo").onclick = "";
document.body.removeChild(document.getElementById("question"));
for (counter = 0; counter < num; ++counter) {
box = document.createElement('input');
box.type = "text";
document.body.appendChild(box);
}
}
})();