Hallo Dodi.
Hier zuerstmein Code:
function mkclickform()
{
if(document.seller.nick.value == "Kundenservice")
{
var element = document.getElementsByName("clickform");
element.innerHTML = "Hallo";
}
}
Dass die Methode getElementsByName aber eine Kollektion und kein einzelnes Objekt zurückgibt, ist dir bewusst?
> Das Element clickform existiert, es ist ein Absatz <p>. Dieses Element nimmt aber nicht den Text "Hallo" an. Die Funktion wird aufgerufen.
>
> ~~~html
> <p NAME="clickform">abc</p>
>
> [..]
>
> <INPUT type="TEXT" name="nick" size="25" value="" onKeyDown="Ticketcount();mkclickform();">
>
Das http://de.selfhtml.org/html/referenz/attribute.htm#p@title=p-Element verfügt über kein name-Attribut. Du möchtest ihm vermutlich eine ID verpassen und diese per getElementById nutzen.
Einen schönen Freitag noch.
Gruß, Ashura
--
sh:( fo:} ch:? rl:( br: n4:~ ie:{ mo:| va:) de:> zu:} fl:( ss:) ls:[ js:|
„It is required that HTML be a common language between all platforms. This implies no device-specific markup, or anything which requires control over fonts or colors, for example. This is in keeping with the SGML ideal.“
[HTML Design Constraints: Logical Markup]
sh:( fo:} ch:? rl:( br: n4:~ ie:{ mo:| va:) de:> zu:} fl:( ss:) ls:[ js:|
„It is required that HTML be a common language between all platforms. This implies no device-specific markup, or anything which requires control over fonts or colors, for example. This is in keeping with the SGML ideal.“
[HTML Design Constraints: Logical Markup]