Thema: "Aktiven" Inputfeldern Style zuweisen

Hallöchen,<P>ich hab ein bischen an Formularen gebastelt,und dabei ein etwas anderes Formular mitgebastelt.<P>Beim Klicken in eines Der Input Felder wird das Feld mit einer anderen Hintergrundfarbe belegt. ( Soll suggerieren das dieses Feld gerade aktiv ist )<P>Jetzt würd mich interessieren ob der Code Cross Browser fähig ist, oder ob da wieder irgendeiner aus der Reihe tanzt...?<P>01 Ihr Name :<BR>02 <input type="text" tabindex="1" size="15" maxlength="25" value="" style="background-Color=#eca64d" <BR>03 onfocus="this.style.backgroundColor='white'" onblur="this.style.backgroundColor='#eca64d'"> <BR>04 Ihr Alter : <BR>05 <input type="text" tabindex="2" size="2" maxlength="3" value="" style="background-Color=#eca64d" <BR>06 onfocus="this.style.backgroundColor='white'" onblur="this.style.backgroundColor='#eca64d'"><P>Grüsse Jochen

Moderator devshare.de | Usability

2

Re: "Aktiven" Inputfeldern Style zuweisen

Ich hab jetzt nix ausprobiert, aber ich denke der NN4 macht da nichts.

3

Re: "Aktiven" Inputfeldern Style zuweisen

N'abend<BR>der NN4 macht schon was, er produziert nämlich ne Fehlermeldung in der javascript-Konsole. <BR>opera bis 6 macht tatsächlich garnix.<BR>Und der NN6 hat andre Rückgabewerte als der IE.<BR>So könntest Du's wenigsten für IE und NN6x<BR>machen, ohne in den andern browsern Fehler zu kriegen:<P><html><BR><head><BR><title>jochen</title><BR><script><BR>var da=document.all,dl=document.layers,wo=window.opera;<BR>function F(f)<BR>{function ff(x,y){f.style.backgroundColor=f.style.backgroundColor==x?y:x};<BR> if(da&&!wo)ff('#ffffff','#eca64d');<BR> if(!da&&!dl)ff('rgb(255,255,255)','rgb(236,166,77)');<BR>};<BR></script><BR></head><BR><body onload='self.focus()'><BR><form><BR>01 Ihr Name :<BR>02 <input type="text" tabindex="1" size="15" maxlength="25" value="" style="background-Color:#eca64d"<BR>03 onfocus="F(this)" onblur="F(this)"><BR>04 Ihr Alter :<BR>05 <input type="text" tabindex="2" size="2" maxlength="3" value="" style="background-Color:#eca64d"<BR>06 onfocus="F(this)" onblur="F(this)"><BR></form><BR></body><BR></html><P><BR>gruß<P><BR>matho