473,386 Members | 1,741 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Form Gray Filter

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

May 31 '08 #1
5 2227
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.someOtherInput.focus() ;
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
May 31 '08 #2
MC
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" <pe**********@gmail.comwrote in message
news:d4**********************************@p39g2000 prm.googlegroups.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.someOtherInput.focus() ;
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

May 31 '08 #3
On May 31, 2:47 pm, "MC" <mica[removethis]@aisus.comwrote:

[posting order restored. Please don't top post on Usenet.]
"Peter Michaux" <petermich...@gmail.comwrote in message

news:d4**********************************@p39g2000 prm.googlegroups.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.someOtherInput.focus() ;
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.
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.
If it is just the opacity stuff that is the problem then you can
insert a div over top of the form, and size it to match the size of
the form. Give the div an background colour of something like #666.
Then you can set the opacity of that div with a cross-browser
setOpacity function. All the mainstream libraries have such a function
and we are standing precariously at the precipice of yet another
discussion about the quality of these mainstream libraries. Here is a
setOpacity function I wrote quite a while ago, if you want to slice
and dice your own.

http://forkjavascript.org/javascripts/fork/style.js

FORK.Style.setOpacity(overlayDiv, .5)

And the docs I wrote

http://forkjavascript.org/style/docs#setOpacity

You can find quite a bit of setOpacity discussion in the group
archives from the past year. It was the focus of some discussion about
cross-browser scripting in general.

Peter
May 31 '08 #4
MC
7
"Peter Michaux" <pe**********@gmail.comwrote in message
news:0a**********************************@q27g2000 prf.googlegroups.com...
On May 31, 2:47 pm, "MC" <mica[removethis]@aisus.comwrote:

[posting order restored. Please don't top post on Usenet.]
>"Peter Michaux" <petermich...@gmail.comwrote in message

news:d4**********************************@p39g200 0prm.googlegroups.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.someOtherInput.focus() ;
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.
>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.

If it is just the opacity stuff that is the problem then you can
insert a div over top of the form, and size it to match the size of
the form. Give the div an background colour of something like #666.
Then you can set the opacity of that div with a cross-browser
setOpacity function. All the mainstream libraries have such a function
and we are standing precariously at the precipice of yet another
discussion about the quality of these mainstream libraries. Here is a
setOpacity function I wrote quite a while ago, if you want to slice
and dice your own.

http://forkjavascript.org/javascripts/fork/style.js

FORK.Style.setOpacity(overlayDiv, .5)

And the docs I wrote

http://forkjavascript.org/style/docs#setOpacity

You can find quite a bit of setOpacity discussion in the group
archives from the past year. It was the focus of some discussion about
cross-browser scripting in general.

Peter
Peter,

We have a cross browser winner. Every place I looked for this it was buried
deep within many lines of libraries and always tied to other code not
dealing with opacity. I will be using this regularly.

THANK YOU!
Mica
Jun 1 '08 #5
SAM
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.getElementById(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=function(){grayer('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="return false;">
<p>test: <input name="test">
<p><button onclick="grayer('f_2',false);grayer('f_1',true);">
change form</button></p>
</form>
<form id="f_2" action="#" onsubmit="return false;">
<p>test: <input name="test">
<p><button onclick="grayer('f_2',true);grayer('f_1',false);">
change form</button></p>
</form>
</html>

--
sm
Jun 1 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Saqib Ali | last post by:
Please excuse me, this is a fairly involved question that will likely require you to save the file below to a file and open it in a browser. I use Mozilla 1.5, so the problem I describe below...
1
by: Robert Neville | last post by:
I would like to add filter functionality to my database whether through the Main form or the subform. This question may be rudimentary, yet I have not less experience with filtering data outside...
0
by: CSDunn | last post by:
Hello, I have a problem with field filtering between an Access 2000 Project form (the application is called CELDT), and the report that shows the results of the filter. Both the form and the...
3
by: Richard | last post by:
Hi, I have a form based on a table. When I filter the form I want to run a report based on the same table with the same filter as the form. No problem until I want to filter a combo box where...
4
by: Dino M. Buljubasic | last post by:
I'd like to check if a form is already open before opening it and if it is not, then open it, otherwise just make it the active form. How can I do that? Regards, Dino --
4
by: Colin McGuire | last post by:
Hi again, thanks everyone for your previous help. But having resolved past problems, I'm moving on to new problems :( This one is a simple winforms application with two buttons, named Button1...
18
by: Colin McGuire | last post by:
Hi - this was posted last weekend and unfortunately not resolved. The solutions that were posted almost worked but after another 5 days of working on the code everynight, I am not further ahead....
3
scubak1w1
by: scubak1w1 | last post by:
Hello, I posted this in the HTML forum, but it was suggested I post it over here as well by a moderator. I have a form that will not 'fire' in non-IE browsers?? I have poked and poked at the code...
3
by: MC | last post by:
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.