As I'm still trying to resolve my other issue (need some help here!), I'm exploring on how to name form elements which are the same, but on different rows.
Following this example here, the author of the article named his textboxes to be "input_box_one". The jQuery function he has written also duplicates the input boxes to have the same name. I would like to know the reason for naming his textboxes like that, and how does the server script he is going to write collect the input from textboxes which are similarly named?
I'm going to be writing in Classic ASP.
<table id = "options-table">
<tr>
<td>Input-Box-One</td>
<td>Input-Box-Two</td>
<td> </td>
</tr>
<tr>
<td><input type = "text" name = "input_box_one[]" /></td>
<td><input type = "text" name = "input_box_two[]" /></td>
<td><input type = "button" class = "del" value = "Delete" /></td>
</tr>
<tr>
<td><input type = "text" name = "input_box_one[]" /></td>
<td><input type = "text" name = "input_box_two[]" /></td>
<td><input type = "button" class = "add" value = "Add More" /></td>
</tr>
</table>
Thanks!
In ASP Classic the Request.Form("someName")
returns an object that implements the IStringList
interface. This interface has two members Item([i]])
which is the default property and Count
.
You should remove the [] suffixes if you are posting to ASP. You can access multiple values that use the same name using the additional indexer parameter i
. E.g.
Dim someValue : someValue = Request.Form("someName")(2)
I can't remember if this collection is 0 or 1 based but should be easy for you to test. The object may also support For Each
as well but that may not be that useful in your scenario.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With