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


No announcement yet.

Changing the DISABLED attribute of a class.

  • 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.


    • #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.

      function enableSend(){
      <FORM name="navForm">
      <select size="4" name="D1" onchange='update()' tabindex="1">
      <OPTION value='1'>Item 1</OPTION>
      <OPTION value='2'>Item 2</OPTION>

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


      • #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">

        for (i=0; i <= document.my_form.elements[].length; i++)
        document.my_form.elements[i].disabeled = true

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