By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,742 Members | 2,044 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,742 IT Pros & Developers. It's quick & easy.

Conflict between form element name and property name.

dmjpro
100+
P: 2,476
I have a following JavaScript code !

Expand|Select|Wrap|Line Numbers
  1. document.forms['CalendarTypeMaster'].elements['action'].value = action;
  2. document.forms['CalendarTypeMaster'].method = "POST";         document.forms['CalendarTypeMaster'].setAttribute('action',"calendarTypeMgmt.htm");
  3. document.forms['CalendarTypeMaster'].submit();
  4.  
The form contains a element name action and form has also a property action, earlier what i did ...that was ..

Expand|Select|Wrap|Line Numbers
  1. document.forms['CalendarTypeMaster'].action="calendarTypeMgmt.htm");
  2. ";
Now it's not working.
Sep 23 '08 #1
Share this Question
Share on Google+
4 Replies


10K+
P: 13,264
Do yourself a favor and don't call any form elements 'action'.
Sep 23 '08 #2

dmjpro
100+
P: 2,476
Do yourself a favor and don't call any form elements 'action'.
How Strange! ;)
r035198x you are here ..first time i seen u over here!
It's Working in Mozilla Engine but not in IE.
Actually how Mozilla handles this conflict ? And why not in IE?
Please Help!
If i change the element name action, then i have to change a lot ..... that's why i try to find out the solution ....and why it happens in IE and why not in Mozilla ...please explain
Sep 23 '08 #3

dmjpro
100+
P: 2,476
Do yourself a favor and don't call any form elements 'action'.
I did that .... actually in any action value the action page refers to the same URI.
So i explicitly mentioned the URI in form action attribute.
But i am looking for the cause of misbehavior or IE ;)
Sep 23 '08 #4

acoder
Expert Mod 15k+
P: 16,027
It's a bug, though you should never use names that are reserved properties anyway. See browser bugs link.
Sep 23 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.