HTML form values ​​containing commas in classic ASP

I have a classic ASP page that returns to itself. Oddly enough, the values ​​returned from the selected ones are added to the ends with commas. Has anyone encountered anything similar before? Any troubleshooting steps or recommended tools?

I expect the values ​​to be returned as numbers - these are identifiers of the values ​​displayed in the option.

I checked the secret commas on the page and cannot find any - not in the data that I am viewing.

(note - these are single, not multiple)

+6
html forms asp-classic
source share
3 answers

It looks like you have duplicate form fields. Your values ​​are combined with commas, for example:

<input type="text" name="name1" value="value1"> <input type="text" name="name1" value="value2"> <input type="text" name="name2" value="value3"> 

becomes

 name1=value1,value2 name2=value3 

If the second name1 does not matter, it becomes

 name1=value1, name2=value3 
+14
source share

Do you have several form elements on your page with the same name?

In classic ASP, multiple form values ​​of the same name are combined into a comma-delimited string in the Request.Form / Request.QueryString collections, so if there is a hidden field or text field with name = "foo" like your <select name = "foo" >, you will get the second (empty) value appended to the first, separated by a comma.

+3
source share

Are there two form elements with the same name? If you have Firebug installed, you should take a look at whether the data is actually sent with commas or if this happens after the ASP gets its terrible paws on it.

+1
source share

All Articles