471,886 Members | 1,104 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,886 software developers and data experts.

IE name="name" & form.name property bug

We just discovered another IE bug.

When an html form contains an element with a name of `name` IE's
internal index screws up the .name property of the containing form to
point to the bad element object instead of containing the string name
property of the form.

Here is the simplified test case:

<html>
<head>
<title>IE Name="name" Bug</title>
<script>
function showFormName(){
alert(
"Text should say `fmTest`~~~> "+
oF["good_name"].form.name+"\n\n"+
"Second test: Test .value prop~~> "+
oF["good_name"].form.name.value
)
}
</script>
</head>
<body>
<form name="fmTest">
<script>oF=document.forms["fmTest"]</script>
Good:
<input type=text name="good_name" value="Good Elem Name">
<script>showFormName()</script>
Bad:
<input type=text name="name" value="Bad Elem Name">
<script>showFormName()</script>
</form>
</body>
</html>

Probably not a good idea to use just `name` anyway `tbName` or similar
is better coding practice any how. We are customizing a system that
uses form element names that match attribute names in our business
object server. `name` is actually the core business object `name`
attribute. We are working around by customizing the TCL core code to
look for obj_name instead.

JsD
Jul 23 '05 #1
6 2188
Java script Dude wrote:
We just discovered another IE bug.
It isn't necessarily a bug and it certainly isn't restricted to IE.
When an html form contains an element with a name of `name` IE's
internal index screws up the .name property of the containing form to
point to the bad element object instead of containing the string name
property of the form.

<snip>

"The Most Common Mistake":-

<URL: http://jibbering.com/faq_notes/form_....html#faComMis >

Richard.
Jul 23 '05 #2
Richard Cornford wrote:

<snip>

"The Most Common Mistake":-

<URL: http://jibbering.com/faq_notes/form_....html#faComMis >


HTTP/1.1 404 Object Not Found
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/
Jul 23 '05 #3
*Randy Webb* wrote:
*Richard Cornford* wrote:
"The Most Common Mistake":-
<URL: http://jibbering.com/faq_notes/form_....html#faComMis >


HTTP/1.1 404 Object Not Found


http://www.jibbering.com/faq/faq_not....html#faComMis
--
Andrew Urquhart
- FAQ: www.jibbering.com/faq/
- Archive: www.google.com/groups?q=comp.lang.javascript
- My reply address is invalid, see www.andrewu.co.uk/contact/
Jul 23 '05 #4
Andrew Urquhart wrote:
*Randy Webb* wrote:
*Richard Cornford* wrote:
"The Most Common Mistake":-
<URL: http://jibbering.com/faq_notes/form_....html#faComMis >


HTTP/1.1 404 Object Not Found

http://www.jibbering.com/faq/faq_not....html#faComMis


Thanks, I knew it was in there somewhere :)

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/
Jul 23 '05 #5
Randy Webb wrote:
Andrew Urquhart wrote:

<snip>
http://www.jibbering.com/faq/faq_not....html#faComMis


Thanks, I knew it was in there somewhere :)


Sorry, it had just occurred to me that I forgot the /faq and I was about
to post a correction. I won't bother now.

Ricahrd.
Jul 23 '05 #6
> >> http://www.jibbering.com/faq/faq_not....html#faComMis

Thanks Richard,

I'll be sure to check the FAQ before any more similar posts.

Tim
Jul 23 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Dick Watson | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.