Form Gray Filter

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

    Form Gray Filter

    Hi,

    I have been looking around for a way to apply the filter that grays out a
    form or div. I found some examples but the code is pretty complex. Any
    simple ways to gray that out so I can highlight another form or div?

    Thanks,
    Mica
    PS. I looked at several of the 'easy' examples and they did not work when I
    applied them.



  • Peter Michaux

    #2
    Re: Form Gray Filter

    On May 31, 2:24 pm, "MC" <mica[removethis]@aisus.comwrote :
    Hi,
    >
    I have been looking around for a way to apply the filter that grays out a
    form or div. I found some examples but the code is pretty complex. Any
    simple ways to gray that out so I can highlight another form or div?
    >
    Thanks,
    Mica
    PS. I looked at several of the 'easy' examples and they did not work when I
    applied them.
    Are you looking to disable the form element?

    document.forms. gs2.elements.q. disabled = true;


    Are you looking to send focus to another element?

    document.forms. gs2.elements.so meOtherInput.fo cus();


    Are you looking for a visual cue that the input is not longer the
    focus or that another one is the focus?

    A little longer.

    Peter

    Comment

    • MC

      #3
      Re: Form Gray Filter

      Peter,

      For example, I have two forms in a page, if the user clicks a button on
      form1, I want to 'gray' or shadow form1 and show form2. I know how do do
      everything but gray the form using the alpha filter stuff.

      Mica

      "Peter Michaux" <petermichaux@g mail.comwrote in message
      news:d4cc3bb4-8e19-4fdc-8796-2d28b4a9996d@p3 9g2000prm.googl egroups.com...
      On May 31, 2:24 pm, "MC" <mica[removethis]@aisus.comwrote :
      >Hi,
      >>
      >I have been looking around for a way to apply the filter that grays out a
      >form or div. I found some examples but the code is pretty complex. Any
      >simple ways to gray that out so I can highlight another form or div?
      >>
      >Thanks,
      >Mica
      >PS. I looked at several of the 'easy' examples and they did not work when
      >I
      >applied them.
      >
      Are you looking to disable the form element?
      >
      document.forms. gs2.elements.q. disabled = true;
      >
      >
      Are you looking to send focus to another element?
      >
      document.forms. gs2.elements.so meOtherInput.fo cus();
      >
      >
      Are you looking for a visual cue that the input is not longer the
      focus or that another one is the focus?
      >
      A little longer.
      >
      Peter

      Comment

      • SAM

        #4
        Re: Form Gray Filter

        MC a écrit :
        >
        For example, I have two forms in a page, if the user clicks a button on
        form1, I want to 'gray' or shadow form1 and show form2. I know how do do
        everything but gray the form using the alpha filter stuff.
        <html>
        <script type="text/javascript">
        function grayer(formId, yesNo) {
        var f = document.getEle mentById(formId ), s, opacity;
        s = f.style;
        opacity = yesNo? '40' : '100';
        s.opacity = s.MozOpacity = s.KhtmlOpacity = opacity/100;
        s.filter = 'alpha(opacity= '+opacity+')';
        for(var i=0; i<f.length; i++) f[i].disabled = yesNo;
        }
        window.onload=f unction(){graye r('f_2',true);} ;
        </script>
        <style type="text/css">
        form { _height: 1%; /* hack IE */
        padding: 10px; background:#ff5 ;
        }
        </style>
        <body>
        <form id="f_1" action="#" onsubmit="retur n false;">
        <p>test: <input name="test">
        <p><button onclick="grayer ('f_2',false);g rayer('f_1',tru e);">
        change form</button></p>
        </form>
        <form id="f_2" action="#" onsubmit="retur n false;">
        <p>test: <input name="test">
        <p><button onclick="grayer ('f_2',true);gr ayer('f_1',fals e);">
        change form</button></p>
        </form>
        </html>

        --
        sm

        Comment

        Working...