Hallo Guma.
ich will mit Javascript prüfen, ob ein Feld weniger als zwei Zeichen hat. Das habe ich so versucht.
if(document.getElementById('q').value.length<2){
Gibt es das Element mit der ID „q“ wirklich und steht es zum Zeitpunkt des Scriptdurchlaufes auch wirklich schon zur Verfügung?
document.getElementById("mybox").style.display='none';return;}
Auf das return kannst du eigentlich verzichten.
Ergbnis konnte ich keines feststellen.
Und welche Fehlermeldungen erhältst du? Was ergab ein Debugging–Durchlauf?
Einen schönen Donnerstag noch.
Gruß, Mathias
--
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]