where to put <form> tag in dynamic rows

In the below code when i write <form> tag after <BODY> i am getting weird exception.
"Internet explorer cannot open internet site ;operation aborted".you can check the code in your browser.

but when i place <form> after end </script> tag then page is coming .i dont know what is the exact problem?Is it browser problem or Coding problem?.I can't put <form> tag after </script> tag cos when i submit page the values will not go the servlet page where i need to read the values and insert into the database.
here i am dynamically creating rows so i need to place <form> tab after <body> tag only.

move your script into the head of the document. Leave your form tag in the body and give it an id, use document.getElementById() to access the form tag in your script and append all of the elements in your script to the form tag. If you need to have multiple forms create your forms in your script. If you need an example let me know and I'll whip one up.

yes... it should work if you append the created elements (cell1, cell2, cell3, etc.) to the the form tag. If it doesn't work with document.form_name.appendChild(appending_elements) create an id for the form and use document.getElementById('form_id').appendChild(appending_elements). That should get you rolling.

I had to cut some code out because it was causing problems... but I did get the code functioning. You'll want to rethink how to count the rows so you can get cell8 and cell9 working properly. Let me know if you need anything else.

Nothing in an HTTP request can be trusted, including HTTP headers and form data. A form token is a tool that can be used to guard against request forgeries (CSRF). This article shows an improved approach to form tokens, making it more difficult to…

The viewer will learn the basics of jQuery including how to code hide show and toggles.
Reference your jQuery libraries:
(CODE)
Include your new external js/jQuery file:
(CODE)
Write your first lines of code to setup your site for jQuery…