Hallo,
irgendwie blicke ich durch diesen kleinen Code nicht mehr.
Wieso wird hier: "document.forms[0].mails has no properties". ausgegeben?
Der Code-Schnipßel ist ein Witz und ich sehe den Fehler trotzdem nicht. Birn out ;-((
Jemand einen Tipp?
Danke und Gruß
Messmar
function checkFriendsMails(){
//alert(document.forms[0].email_4.value);
var i;
var mails = new Array("email_1", "email_2", "email_3", "email_4");
//alert(mails.length);
for(i=0; i<mails.length; i++){
alert(mails[i]);
if (document.forms[0].mails[i].value == "") alert('Plese fill in the Fields');
else alert('That is fine, go a head');
}
}
Der zugehörige Html-Code:
<form name="qqqqa" onsubmit=" checkFriendsMails();">
<label style="width:180px;background:transparent;"><strong>Friends email adresses:</strong></label>
<br>
<ul style="list-style-type: decimal;font-size:10px;">
<li><input type="text" name="email_1" value="" /></li>
<li><input type="text" name="email_2" value="" /></li>
<li><input type="text" name="email_3" value="" /></li>
<li><input type="text" name="email_4" value="" /></li>
</ul>
<input type="Submit" value="xxxx">
</form>