Conflict between form element name and property name.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    Conflict between form element name and property name.

    I have a following JavaScript code !

    [code=JavaScript]
    document.forms['CalendarTypeMa ster'].elements['action'].value = action;
    document.forms['CalendarTypeMa ster'].method = "POST"; document.forms['CalendarTypeMa ster'].setAttribute(' action',"calend arTypeMgmt.htm" );
    document.forms['CalendarTypeMa ster'].submit();
    [/code]

    The form contains a element name action and form has also a property action, earlier what i did ...that was ..

    [code=text]document.forms['CalendarTypeMa ster'].action="calend arTypeMgmt.htm" );
    ";[/code]
    Now it's not working.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Do yourself a favor and don't call any form elements 'action'.

    Comment

    • dmjpro
      Top Contributor
      • Jan 2007
      • 2476

      #3
      Originally posted by r035198x
      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

      Comment

      • dmjpro
        Top Contributor
        • Jan 2007
        • 2476

        #4
        Originally posted by r035198x
        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 ;)

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          It's a bug, though you should never use names that are reserved properties anyway. See browser bugs link.

          Comment

          Working...