JavaScript kode
Heysa jeg har denne her kode der tester om man har udfyldt nogle felter, men hvordan tager jeg funktionen der tester om de to pwds og emails er ens væk?script>
if (email != email2) {
alert ("\nDe indtastede emails matchede ikke. Prøv igen.")
return false;
}
return true;
}
function verify(TheForm) {
var themessage = "Du er nød til at udfylde følgende felter: ";
if (TheForm.navn.value=="") {
themessage = themessage + "\nFulde navn";
}
if (TheForm.adresse.value=="") {
themessage = themessage + "\nAdresse";
}
if (TheForm.city.value=="") {
themessage = themessage + "\nBy";
}
if (TheForm.post.value=="") {
themessage = themessage + "\nPost nr.";
}
if (TheForm.email.value=="") {
themessage = themessage + "\nEmail";
}
if (TheForm.tlf.value=="") {
themessage = themessage + "\nTelefon nr.";
}
if (themessage == "Du er nød til at udfylde følgende felter: ") {
return true;
}
alert(themessage);
return false;
}
function CheckMinForm(inpForm) {
if (!verify(inpForm)) {
return false;
}
if (!checkPw(inpForm)) {
return false;
};
if (!checkEm(inpForm)) {
return false;
};
return true;
}
</script>
