Accessing javascript-generated textboxes with ASP.NET

  • Thread starter Thread starter jeroen.bolle
  • Start date Start date
J

jeroen.bolle

I'm designing a form where the user can decide how many options for a
poll he wants to add. There's a "+" button to dynamically add
textboxes with javascript, without a postback.

How do I access these newly generated <input type="text" id="..." />
elements with ASP.NET to save it to a database?
 
pretty trival.

the javascript textbox postback values will be in the Request.Form
collection. the collection key will be the name the javascript gave as the
name of the <input>. if the names is the same for all the controls, the value
will be a comma seperated string of each value. more common is to append a
counter to the end of the same.

it would also be pretty trival to make a server control that dynamically
created a asp:textbox for each of the postback values, and exposed them as
controls. or the control could expose a collection of values.

-- bruce (sqlwork.com)
 
Back
Top