PDA

View Full Version : Forms



L?KE
23-11-2008, 09:45 PM
Alreet ;)

How do I change the style of an active form.

I can do hover and that.

is it literally -



input:active {
}


or not? :) ty all.

Moved by Meti (Forum Moderator) from Designing and Development: Please post in the correct forum next time, thanks ;).

Joe!
23-11-2008, 09:52 PM
That would be my guess. Just try it.

Excellent2
23-11-2008, 09:53 PM
Could try input:a too?

L?KE
23-11-2008, 09:55 PM
Lol it does work, but only when being clicked.

Excellent2
23-11-2008, 09:58 PM
Could try inactive then? :P

L?KE
23-11-2008, 10:00 PM
What about JS onfocus?

Excellent2
23-11-2008, 10:00 PM
You could do but try it with CSS first :)

Joe!
23-11-2008, 10:01 PM
Could try input:a too?
That would be a link though wouldn't it? Correct me if i'm wrong, you know i'm bad at css :p

L?KE
23-11-2008, 10:01 PM
WOOT!

<input type="text" name="lucasFTL" onFocus="this.style.color='red'" />

Excellent2
23-11-2008, 10:19 PM
What's FTL? :)

L?KE
23-11-2008, 10:23 PM
http://www.urbandictionary.com/define.php?term=ftl

Excellent2
23-11-2008, 10:26 PM
http://www.urbandictionary.com/define.php?term=ftl
Using terms you have to use urbandictionary to define the meaning for.. story of your life Luke :) :8

Jxhn
24-11-2008, 07:03 AM
WOOT!

<input type="text" name="lucasFTL" onFocus="this.style.color='red'" />

<input type="text" name="lucasFTL" onFocus="this.style.color='#FF0000'" onBlur="this.style.color='#000000'" />

Would look better if you used backroundColor imo.

Calon
24-11-2008, 07:11 AM
It's a bit like NTL but it's not bankrupt.

L?KE
24-11-2008, 05:55 PM
@Jxhn, I'm not just changing the bg colour.

For anyone who cares or could do with it, I styled each one accordingly

(.normal {} , .active{} )

and then implemented the following:


<script type="text/javascript">

function focusIN(what) {

if(what.className == "normal") {

what.className = "active";

}

}

function blurIN(what) {

if(what.className == "active") {

what.className = "normal";

}

}

</script>
<input type="text" name="text" value="Text Input" class="normal" onFocus="focusIN(this)" onBlur="blurIN(this)" />

Want to hide these adverts? Register an account for free!