SEP
IE6 wants to hide my post values - the horror!
Posted by Lee under Programming
I hit what would have to be one of the freakiest and hardest to replicate bugs in IE6 today. It all started when a client said a form they were using was coming up with missing post index errors. I spent forever trying to replicate and see what they were doing. Simply put if they pasted a certain bit of content into a plain textarea box the first post value would automagically disappear. That first value for us was a hidden value defining if you were adding or editing an item - kind of important!
After plenty of searching I managed to come across the certain factors that need to be in place for this to happen and hopefully this might just one day help someone else out.
- Client using IE6
- Form needs enctype=”multipart/form-data”
- Textarea value needs character that MS Word creates that is three dots
Then upon submitting your first post value will dissappear. Here is a link to a PHP Bug thread covering the issue - and it’s not PHP specific, its purely IE6. Below is the sample code that will reproduce the error:
<form method="post" action="whatever" enctype="multipart/form-data">
<input type="text" name="field1" value="1">
<input type="text" name="field2" value="2…">
<input type="checkbox" name="field3" value="3">
<input type="submit">
</form>
All I have done to stop it in the meantime is added a ‘fake’ hidden post value at the start so it gets destroyed instead of a value that is actually required.
