Site Navigation

Wednesday, March 19, 2008

bug 366 - we call a rose by any other name would... IE JS Error?

Issue: #366
Affects: IE6, IE7

"What's in a name? That which we call a rose by any other name would smell as sweet."
- William Shakespear (Romeo and Juliet, Act II, Sc. II)


Have you ever tried to rename an input field with JavaScript just before submitting a form? Quite likely, and it works just fine... or does it?

There are times when renaming a field is easier than deleting and inserting a new one. When such a time arises, a simple:

Example:

<script type="text/javascript">
document.forms[0].elements['rose'].name = 'flower';
</script>


Will work just fine. When you submit the page, the parameter on the GET/POST request/submission will be called "flower".

However if you plan to use JavaScript to re-access that field in IE (e.g. to perform some client side field validation), don't try to access it by name! It will work in all browsers except Internet Explorer.


Known Workarounds: None.



Related Issues: (bug 152), (bug 162), (bug 235), (bug 237), (bug 240), (bug 242), (bug 411).

Bug/Site Feedback |
Submit a bug