This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > March 2006 > Css question for disabled form elements





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Css question for disabled form elements
Alejandro

2006-03-28, 6:29 pm

Hi,

I am trying to apply a css whenever a form element is disabled.

I tried adding this lines to the .css that is linked to the page,
unfortunately looks like I am missing something since the css is not
automatically applied when the form element becomes disabled.

..disabled{color:#FF0000; background-color:#0000FF;}

Any ideas what may be missing ?

Aleks


crash

2006-03-28, 6:29 pm

I suggested using the Swap class extension in conjunction with this. (ie,
whatever javascript disables your form elements have it also swap your class
to 'disabled').

you should be able to find it on the exchange or on http://projectseven.com
's website.
"Alejandro" <arkark2004@hotmail.com> wrote in message
news:e09ic9$rc6$1@forums.macromedia.com...
> Hi,
>
> I am trying to apply a css whenever a form element is disabled.
>
> I tried adding this lines to the .css that is linked to the page,
> unfortunately looks like I am missing something since the css is not
> automatically applied when the form element becomes disabled.
>
> .disabled{color:#FF0000; background-color:#0000FF;}
>
> Any ideas what may be missing ?
>
> Aleks
>



Alejandro

2006-03-28, 6:29 pm

I have already posted in their forum but no answer after more than 48 hours.

:(


"Alejandro" <arkark2004@hotmail.com> wrote in message
news:e09ic9$rc6$1@forums.macromedia.com...
> Hi,
>
> I am trying to apply a css whenever a form element is disabled.
>
> I tried adding this lines to the .css that is linked to the page,
> unfortunately looks like I am missing something since the css is not
> automatically applied when the form element becomes disabled.
>
> .disabled{color:#FF0000; background-color:#0000FF;}
>
> Any ideas what may be missing ?
>
> Aleks
>



Alejandro

2006-03-28, 6:29 pm

I am using it, unfortunately seems to have a bug and also swaps other
elements.
And I am not sure how to add code to swap the css using the extension

A


"crash" <crash@bcdcdigital.com> wrote in message
news:e09n4b$4av$1@forums.macromedia.com...
>I suggested using the Swap class extension in conjunction with this. (ie,
>whatever javascript disables your form elements have it also swap your
>class to 'disabled').
>
> you should be able to find it on the exchange or on
> http://projectseven.com 's website.
> "Alejandro" <arkark2004@hotmail.com> wrote in message
> news:e09ic9$rc6$1@forums.macromedia.com...
>
>



Murray *ACE*

2006-03-28, 6:29 pm

Give me an example of the HTML markup that this element would have, please.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"Alejandro" <arkark2004@hotmail.com> wrote in message
news:e09ic9$rc6$1@forums.macromedia.com...
> Hi,
>
> I am trying to apply a css whenever a form element is disabled.
>
> I tried adding this lines to the .css that is linked to the page,
> unfortunately looks like I am missing something since the css is not
> automatically applied when the form element becomes disabled.
>
> .disabled{color:#FF0000; background-color:#0000FF;}
>
> Any ideas what may be missing ?
>
> Aleks
>



crash

2006-03-28, 6:30 pm

I'm not sure what code the extension uses, but this should be how you can do
it.

Select an element on your page, preferably a link. (Make sure it has a
class or id associated with it) Apply the "swap class" behavior. It should
give you some options as to what other classes you want to switch it to,
ect.

You should have had something like this before:

<a href="whatever.html" class="one">Link</a>

And after you should have something like this:

<a href="whatever.html" class="one"
onClick="javascript:PVSwapClass('thisClass','ThisOtherClass')">Link</a>

The "onClick, onMouseOver" or whatever event is firing your swap class. You
should be able to replicate this by simply copying the code and placing it
wherever you need it to fire.

You may need to build a bit of custom made javascript here, saying something
like offFocus="javascript:MyScript('varThis')"

and then write a bit of script like:

MyScript {
varThis = ID if your element you fired from
if (Form.Element.ID.value = "Condition that Greys out other boxes"){
PVSwapClass("Form.varThis.ID", "ThisClass");}
}

That's extremely rough, and not just cause I've not had enough coffee today.
:) You'll definitely need to check out your javascripting - none of that is
remotely valid.

Basically you have Box1 that determines if Box2 is available. So, you need
to capture the element ID of Box1, and the value of box1, and feed it to
your script. If the value from Box1 = the conditions you need to turn box 2
off (or on). The Javascript will help you capture the ID of your form
element, and the value, then determine if the next form element is available
or not (via the css).

Does that help?


Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews