473,396 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 2276
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: John Davis | last post by:
I want to know what's the differences between Request.Form("Field Name") and Request.QueryString("Field Name") OR they function exactly the same, which is to return the value of the field?? ...
4
by: Marc Elser | last post by:
Hi Everybody, Can someone please tell me how to access the form name if there's a form field named "name", for example: <form name="myform"> <input type="text" name="name" value="Marc">...
3
by: Pavils Jurjans | last post by:
Hello, I have bumped upon this problem: I do some client-side form processing with JavaScript, and for this I loop over all the forms in the document. In order to identify them, I read their...
7
by: charliewest | last post by:
Using .Net Compact Framework, I have an ImageButton control (derived from the Button control) this is wired to a click event. The click event's receives the standard arguments (sender, e). How is...
0
by: Joeyej | last post by:
Hi - I'm trying to move/use a web form (containing some javascript field checks) previously hosted on a Windows 2000 server. However, the FORM METHOD="post..." command in the form (shown below)...
4
by: ajschuster | last post by:
I cannot get my Javascript to work in Firefox. I am just trying to access the .name property of a DIV tag but it keeps coming back as "undefined". The same code works in IE and it works in...
2
by: Me | last post by:
I am passing on the input name to my asp page using Response.redirect "mypage.asp?name=" & name and the resulting url looks like 'companyname/mypage.asp?name=" & name I would like it to appear...
6
by: Dick Watson | last post by:
I had a page that works when setup like this: === <form name="frmCalc" action=""> <script type="text/javascript"> function btnCalc_onclick(abc) { return "got here with " + abc; }
1
by: mark | last post by:
Forgive me if this seems like a stupid question but I need help... I'm trying to do a simple online form that emails me the results from a few fields. Here is the code: <form...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.