Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    May 2012
    Posts
    47
    Thanks
    3
    Thanked 0 Times in 0 Posts

    document.for.action NOT working in IE

    Hi,

    In my javascript function document.form.action is not working in Internet Explorer but in Firefox.

    Please help to make it work on both browsers.

    Thanks.

  • #2
    New Coder
    Join Date
    Sep 2012
    Posts
    22
    Thanks
    0
    Thanked 6 Times in 6 Posts
    you can try this.
    document.forms.namedItem("formName").setAttribute( "attribute","value", true/false);

  • Users who have thanked shyagrawal for this post:

    xaverian (10-10-2012)

  • #3
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,982
    Thanks
    203
    Thanked 2,536 Times in 2,514 Posts
    document.formname.action should work in all browsers. So does
    document.forms[0].action = "whateverURL";
    or
    this.form.action = "whateverURL";


    Check you do not have a form field named "action". If you do rename that field.


    All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.
    Last edited by Philip M; 10-10-2012 at 09:43 AM.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • Users who have thanked Philip M for this post:

    xaverian (10-10-2012)

  • #4
    New Coder
    Join Date
    May 2012
    Posts
    47
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Philip,
    Thanks. You are right. It works on all browser. I had a form field with the name 'action' hence faced the problem. Just renamed it and it starts working.

  • #5
    New Coder
    Join Date
    May 2012
    Posts
    47
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thanks ShyAgrawal


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •