the value for disabled

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Navall

    #1

    the value for disabled

    How to activate disabled button or text?
    Example
    <form name="form">
    <input name="w1" type="checkbox" onClick="docume nt.form.m1.???? ??;"> <----
    what should there be? disabled="false " or unabled="true" doesn't work
    blabla <input name="m1" type="text" value="" size=5 disabled>
    </form>

    TIA
    Navall


  • Vincent van Beveren

    #2
    Re: the value for disabled


    <input name="w1" type="checkbox"
    onClick="docume nt.form.m1.disa bled=this.check ed;">

    <input name="w1" type="checkbox"
    onClick="docume nt.form.m1.disa bled!=this.chec ked;">

    <input name="w1" type="checkbox"
    onClick="docume nt.form.m1.disa bled=false;">

    Should all work... what flavour do you want?

    Comment

    • Navall

      #3
      Re: the value for disabled

      > <input name="w1" type="checkbox"[color=blue]
      > onClick="docume nt.form.m1.disa bled=this.check ed;">
      >
      > <input name="w1" type="checkbox"
      > onClick="docume nt.form.m1.disa bled!=this.chec ked;">
      >
      > <input name="w1" type="checkbox"
      > onClick="docume nt.form.m1.disa bled=false;">[/color]

      It's exactly what I need thx a lot

      Navall


      Comment

      • Richard Cornford

        #4
        Re: the value for disabled

        Vincent van Beveren" wrote:[color=blue]
        >
        > <input name="w1" type="checkbox"
        > onClick="docume nt.form.m1.disa bled=this.check ed;">[/color]

        As the various form controls are part of the same form the onclick
        handler of any one may refer to the form in general as - this.form -
        (that is not by form-name in this case, "form" is probably not the best
        choice of name for a form. The form controls (- this -) all have a
        property named - form - that refers to the form that contains them (if
        any).). So:-

        onclick="this.f orm.elements.m1 .disabled = this.checked;"

        - or -

        onClick="this.f orm.m1.disabled =thischecked;"
        [color=blue]
        > <input name="w1" type="checkbox"
        > onClick="docume nt.form.m1.disa bled!=this.chec ked;">[/color]
        <snip>

        That - != - operation is comparison and has a boolean result that is
        never used. The balance of probability is that an assignment of NOT
        this.checked was intended:-

        onClick="docume nt.form.m1.disa bled= !this.checked;"

        Richard.


        Comment

        • Vincent van Beveren

          #5
          Re: the value for disabled

          [color=blue]
          > That - != - operation is comparison and has a boolean result that is
          > never used. The balance of probability is that an assignment of NOT
          > this.checked was intended:-
          >
          > onClick="docume nt.form.m1.disa bled= !this.checked;"
          >
          > Richard.
          >
          >[/color]

          Thats what I meant... I think I have been behind a screen too much
          today, all the characters are floating around in my brain :)

          Comment

          Working...