Web Analytics Made Easy -
StatCounter Changing the DISABLED attribute of a class. - CodingForum

Announcement

Collapse
No announcement yet.

Changing the DISABLED attribute of a class.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Changing the DISABLED attribute of a class.

    Is it possible to change the DISABLED attribute of an entire class? I can do a series of FORM ELEMENTS via a script, if they are all sequentially numbered, but I would like to do something like this:
    document.CLASSNAME.DISABLED = false;

    Any ideas?

  • #2
    Umm, in theory you could dynamically add two properties to a class, via DOM2 Style for Gecko, and some crap proprietary cod for IE, with two properties:

    -moz-binding: url(somexml.xml#mybinding);
    behavior: url(somebehavior.htc);

    And in those two documents, have it set the disabled property to false... if you're interested in this solution, let me know and I can whip up the document for you.
    jasonkarldavis.com

    Comment


    • #3
      Guess what... couldn't find a way to do it with classes, BUT!!!! You can do it with FIELDSETs. Tho it's not documented as so, you can. Now it should also disable the elements inside the fieldset so that they do not get sent. Radios do not work, nor do checkboxes. I will be trying this soon. Here's some of the code.

      <SCRIPT>
      function enableSend(){
      document.navForm.pkgs.disabled=false;
      document.navForm.B1.disabled=false;
      }
      </SCRIPT>
      <BODY>
      <FORM name="navForm">
      <select size="4" name="D1" onchange='update()' tabindex="1">
      <OPTION value='1'>Item 1</OPTION>
      <OPTION value='2'>Item 2</OPTION>
      </select>

      <fieldset id="pkgs" DISABLED>
      <legend><b>Packages</b></legend>
      <table border="0" cellpadding="0" cellspacing="0" width="375">.......
      </table>
      </fieldset>
      <input type="submit" value="Add This Image To Order" name="B1" DISABLED>
      </FORM>
      </BODY>

      Comment


      • #4
        if you want to dissable a whole form (or others)

        you could use this

        <form name="my_form">
        <input type="text" name="whatever">
        <input type="button" name="whocares" value="doesntmatter">
        </form>

        <script>
        for (i=0; i <= document.my_form.elements[].length; i++)
        {
        document.my_form.elements[i].disabeled = true
        }
        </script>

        i hope that works seen as i havnt tested it but something like that should
        photoshop too expensive? use the GIMP! www.gimp.org

        Comment

        Working...
        X