autogenerate input and select code.

Hi

If i have this code
<html>
<body>
<form action="">
Opskrift: 
<input type="text" name="ops" value="Navn på opskrift" /><br /><br />
Ingrediens 1: <input type="text" name="in1" value="Ingrediens 1" />
<select>
  <option>ml.</option>
  <option>dl.</option>
  <option>l.</option>
  <option>tsk.</option>
</select>
<br />
<input type="submit" value="Tilføj" />
</form>
</body>
</html>

Open in new window


how can i then make a code that will create a input and select code under the first one if starting to write in the first one.
and again, if typing in the 2. one then generate a new.

so if i write something in input 1 then it make a input 2, and if i type in that then it make a new one. so if i have typed in 3 then the live code html will look lige this.

<html>
<body>
<form action="">
Opskrift: 
<input type="text" name="ops" value="Navn på opskrift" /><br /><br />
Ingrediens 1: <input type="text" name="in1" value="Ingrediens 1" />
<select>
  <option>ml.</option>
  <option>dl.</option>
  <option>l.</option>
  <option>tsk.</option>
</select>
<br />
Ingrediens 2: <input type="text" name="in2" value="Ingrediens 2" />
<select>
  <option>ml.</option>
  <option>dl.</option>
  <option>l.</option>
  <option>tsk.</option>
</select>
<br />
Ingrediens 3: <input type="text" name="in3" value="Ingrediens 3" />
<select>
  <option>ml.</option>
  <option>dl.</option>
  <option>l.</option>
  <option>tsk.</option>
</select>
<br />
<input type="submit" value="Tilføj" />
</form>
</body>
</html>

Open in new window


hiope u understand me..
tjgrindstedAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Praveen VenuTechnical Project ManagerCommented:
Put an ASP.Net panel.
Instead of this textbox put an ASP.Net serverside textbox. Set the AutoPostback property to true and in the Textchanged event

for(int i=1;i<= int.Parse(Textbox1.Text);i++)
 Panel1.Controls.Add(new DropdwonList());

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tjgrindstedAuthor Commented:
worked nice
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.