Extra Comma in Request.Form
Posted by admin on April 26, 2008 | No Comments
Just in case you run into this weird situation: You have a web page with a rather extensive form (that really should be broken up into multiple pages, but that’s another discussion), submit the form, and you end up with extra commas that are getting submitted to your database.

Here’s one troubleshooting tip (that could save you the better part of an hour): Make sure you don’t happen to have multiple input fields with the same name. True story!
It doesn’t even matter whether you are using Classic ASP, PHP, ASP.NET, JSP, ColdFusion, AJAX or JavaScript: If you happen to have multiple fields with the same name, you will end up getting value 1, value 2… etc. in your form response.
Obviously, errors such as this stem from COPY & PASTE jobs and deadline pressure. And it’s extremely easy to overlook something like this if you’re working with web designers and/or graphic artists who mock up the forms and then hand it over to the back-end developers.
As with any error that takes a while to track down, if somebody else runs into this kind of situation and spends a long time trying to figure out what’s going on (pulling their hair out and increasing the caffeine intake), all they say, when you figure out what’s going on and you tell them — thereby saving them additional minutes and/or hours of troubleshooting — is, “Oh, duh! That’s silly. Thanks.”
Yes, it is.
Tags:Classic ASP, HTML Form, VBScript
Filed Under: Web Design and Development