Am incercat acolo inainte sa intreb si nu zice nimic de asta.
Un raspuns concret ai?
Function checkZip(zip) {
if (zip. length == 0) {
window.alert("You must provide a ZIP code.");
return false;
}
zip = zip.replace("-","");
if (zip. length!= 5 && zip. length!= 9) {
window.alert("ZIP codes must take the form 12345 or Æ
12345-6789");
return false;
}
for (i=0; i "9") {
window.alert("ZIP codes must only contain numbers.");
return false;
}
}
return true;
}
Listing 99-function checkZip(zip) {
if (zip. length == 0) {
window.alert("You must provide a ZIP code.");
return false;
}
zip = zip.replace("-","");
if (zip. length!= 5 && zip. length!= 9) {
window.alert("ZIP codes must take the form 12345 or Æ
12345-6789");
return false;
}
for (i=0; i "9") {
window.alert("ZIP codes must only contain numbers.");
return false;
}
}
return true;
}
deci de javascript, aveam ceva scris dar nu gasesc acum
Function checkCreditCard(card) {
if (card. length == 0) {
window.alert("You must provide a credit card number.");
return false;
}
card = card.replace(" ","");
if (card.substring(0,1) == "4") {
if (card. length!= 13 && card. length!= 16) {
window.alert("Not enough digits in Visa number.");
return false;
}
} else if (card.substring(0,1) == "5" && Æ
(card.substring(1,2) >= "1" && card.substring(1,2)