Strange behavior on Posting hidden input fields
I can't always reproduce this bug, but maybe someone has experienced something similar...
For some strange reason, under certain circumstances, which I haven't yet been able to identify, sometimes the actual value gets a comma appended to the beginning of it.
user clicks on image that calls mySubmit('doSomething')
theForm.cmd.value = cmdName;
alert(cmdName); // displays value I expect
then in VS.NET
myVar = Request.Form["cmd"].ToString().Trim();
// sometimes myVar = ",doSomething"
// instead of just "doSomething"
Wednesday, June 18, 2003
You could have several controls on the page with the same name. When this happens the values sent to the server get comma delimited which would explain what you are seeing.
I'd recomment checking the source of the page once it gets to the browser in case .NET has decided to do something fruity.
Thats my best guess anyway
Thursday, June 19, 2003
Thans Colin. I thought I checked my HTML for duplicate names, but I'll double check.
Friday, June 20, 2003
Double checked and finally found a duplicate hidden input with the same name attribute.
Thanks for pointing me in the right direction.
Wednesday, June 25, 2003
Fog Creek Home