så här ser min kod ut för ifyllande av formulär:
<center>
<form onSubmit="return form_validator(this)" method="post" action="registrering.asp">
<SCRIPT language="JavaScript"><!-- //script hider
function form_validator(theForm)
{
if(theForm.namn.value == "") {
alert("Du måste fylla i ditt namn");
theForm.email.focus();
return(false);
}
if(theForm.adress.value == "") {
alert("Du måste fylla i din adress");
theForm.namn.focus();
return(false);
}
if(theForm.postadress.value == "") {
alert("Du måste fylla i din postadress");
theForm.adress.focus();
return(false);
}
if(theForm.telefon.value == "") {
alert("Du måste fylla i ditt telefonnummer");
theForm.postadress.focus();
return(false);
}
if(theForm.email.value == "") {
alert("Du måste fylla i din epost-adress");
theForm.postadress.focus();
return(false);
}
if(theForm.personnummer.value == "") {
alert("Du måste fylla i ditt personnummer");
theForm.postadress.focus();
return(false);
}
if(theForm.anvendarnamn.value == "") {
alert("Du måste välja ett användarnamn");
theForm.postadress.focus();
return(false);
}
if(theForm.losenord.value == "") {
alert("Du måste välja ett lösenord");
theForm.postadress.focus();
return(false);
}
if(theForm.upprepalosenord.value == "") {
alert("Du måste upprepa lösenordet");
theForm.postadress.focus();
return(false);
}
return (true);
}
// end script hiding --></SCRIPT>
Namn: <input type="text" name="namn"><br>
Adress: <input type="text" name="adress"><br>
Postadress: <input type="text" name="postadress"><br>
Telefon: <input type="text" name="telefon"><br>
E-post: <input type="text" name="email"><br>
Personnummer: <input type="text" name="personnummer"><br>
Användarnamn: <input type="text" name="anvendarnamn"><br>
Lösenord: <input type="password" name="losenord"><br>
Upprepa lösenord: <input type="password" name="upprepalosenord"><br>
<Input type="submit" Value="Registrera">
</form>
</center>
vad jag nu undrar hur man kan jämföra tecknen i formulären losenord och upprepalosenord eftersom jag vill att dom skall inehålla samma tecken...
tack på förhand :)