Exandable web form

sswingle

Diamond Member
Mar 2, 2000
7,183
45
91
Is there any way to create a never ending web form based on how much the end user needs to enter, kind of like a table?

Example:


Item # Quantity

_______ ____________
_______ ____________

Submit Clear More

Each time the user would click more, they would get two new text boxes to put in another item and quantity.
Naming the fields can just go sequentially, like text_item1, text_item2, etc.

Am open to html, java, or asp, unless there is another easy solution.

Thanks!
 

Drakkon

Diamond Member
Aug 14, 2001
8,401
1
0
Heres a shot using JavaScript you'd have to handle each row using the POST material
 

sswingle

Diamond Member
Mar 2, 2000
7,183
45
91
I tried that, the form shows up, but clicking add new doesn't do anything in both IE and Firefox...

All I did was copy and paste that into a new html file. Was that correct?
 

Woosta

Platinum Member
Mar 23, 2008
2,978
0
71
Originally posted by: Dhaval00
If you're using ASP.NET, this sort of functionality is easily available via controls like GridView, FormView, etc.

Ugh. ASP.NET usually spits out utter crap markup that belongs in the 90s.

Here's my take on it..

 

sswingle

Diamond Member
Mar 2, 2000
7,183
45
91
Originally posted by: Woosta
Originally posted by: Dhaval00
If you're using ASP.NET, this sort of functionality is easily available via controls like GridView, FormView, etc.

Ugh. ASP.NET usually spits out utter crap markup that belongs in the 90s.

Here's my take on it..

Drakkon's still isn't working, even with the link. This though works, and is exactly what i wanted. Thanks!
 

imported_Dhaval00

Senior member
Jul 23, 2004
573
0
0
Originally posted by: Woosta
Originally posted by: Dhaval00
If you're using ASP.NET, this sort of functionality is easily available via controls like GridView, FormView, etc.

Ugh. ASP.NET usually spits out utter crap markup that belongs in the 90s.

Here's my take on it..

I'll agree that the markup generated by ASP.NET 2.0 is fucked up. In .NET 2.0, there are ways which will give you additional control in what you need to do - I hardly use the GridView now... I just create my own templates via controls like DataList and Repeater. This is manual work, but the data binding abilities and in line expressions are just too good to pass on. At the end of the day, if you don't like the ASP.NET's auto generated code, you can always create your own control by inheriting from CompositeDataBoundControl or CompositeControl and implementing IDataItemContainer, IBindableTemplate, etc.

ASP.NET in Framework 3.5 has improved the markup a lot. The ListView control is kick ass once you get a grasp on the internal workings like data binding and templates.

At the end of the day, I could do everything in JavaScript and HTML, but realistically most of my projects are driven by deadlines... I hate to say it but the overhead of maintaining all that JavaScript (plus it always gets complex with things like state, back-end DB, etc.) just gives me the goosebumps.