enabling all fields on a form

Discussion in 'Javascript' started by jpw, Aug 5, 2007.

  1. jpw

    jpw Guest

    I've got a script for enabling all fields on a form (below). However,
    it doesn't work for FireFox (and probably Safari). Ideas to get it
    working in FF?


    <script language="JavaScript">
    function disableAllSelectFields(){
    var f = document.getElementsByTagName('select');
    for(var i=0;i<f.length;i++){
    f.setAttribute('disabled',false)
    }
    }
    </script>


    Thanks,


    jpw
     
    jpw, Aug 5, 2007
    #1
    1. Advertising

  2. On Aug 5, 12:28 pm, jpw <> wrote:
    > I've got a script for enabling all fields on a form (below). However,
    > it doesn't work for FireFox (and probably Safari). Ideas to get it
    > working in FF?


    > f.setAttribute('disabled',false)}


    Avoid setAttribute, it is very broken in IE (which is why this code
    seems to work there).

    f.disabled = false;

    --
    David Dorward
    http://dorward.me.uk/
    http://blog.dorward.me.uk/
     
    David Dorward, Aug 5, 2007
    #2
    1. Advertising

  3. jpw

    jpw Guest

    On Aug 5, 7:37 am, David Dorward <> wrote:
    > On Aug 5, 12:28 pm, jpw <> wrote:
    >
    > > I've got a script for enabling all fields on a form (below). However,
    > > it doesn't work for FireFox (and probably Safari). Ideas to get it
    > > working in FF?
    > > f.setAttribute('disabled',false)}

    >
    > Avoid setAttribute, it is very broken in IE (which is why this code
    > seems to work there).
    >
    > f.disabled = false;
    >
    > --
    > David Dorwardhttp://dorward.me.uk/http://blog.dorward.me.uk/


    Many thanks, David!!
     
    jpw, Aug 5, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Assimalyst
    Replies:
    3
    Views:
    1,932
    Assimalyst
    Aug 9, 2005
  2. Mr. SweatyFinger

    get all the form fields in a form

    Mr. SweatyFinger, Jan 26, 2007, in forum: ASP .Net
    Replies:
    20
    Views:
    898
    Alexey Smirnov
    Jan 31, 2007
  3. Stijn Goris

    enabling form elements

    Stijn Goris, Jul 27, 2004, in forum: Javascript
    Replies:
    7
    Views:
    100
    Harag
    Jul 29, 2004
  4. Malinmore

    hiding-enabling text fields

    Malinmore, Jul 27, 2008, in forum: Javascript
    Replies:
    1
    Views:
    110
    C. (http://symcbean.blogspot.com/)
    Jul 27, 2008
  5. Replies:
    23
    Views:
    584
    Tim Streater
    Dec 18, 2013
Loading...

Share This Page