Är helt värdelös på javascript. Skulle nån kunna hjälpa mig att satta ihopp dessa 3 koder till 1? Skulle vilja ha det i den ordning som det är här nedanför.
[kod]
<script language="javaScript">
function mess()
{
if (document.post.username.value.length<3)
{
alert("Your username cannot be less than 3 characters!");
document.post.username.focus();
return false;
} else if (document.post.fname.value=="")
{
alert("You forgot to enter your first name!");
return false;
} else if (document.post.lname.value=="")
{
alert("You forgot to enter your last name!");
return false;
} else if (document.post.city.value.length<3)
{
alert("The name of the city where you live cannot be less than 3 characters!");
document.post.city.focus();
return false;
}
}
</script>
<script language="javaScript">
function mess()
{
var pass1 = document.post.password1.value;
var pass2 = document.post.password2.value;
if (pass1 != pass2)
{
alert("Passwords did not match!");
return false;
}
if (pass1.length \< 4)
{
alert("Your password cannot be less than 4 characters in length!");
return false;
}
return true; // Jag som antar...
}
</script>
<script language="javaScript">
function mess()
{
if (document.post.code.value.length<5)
{
alert("Your active code cannot be less than 5 characters!");
document.post.code.focus();
return false;
}
}
</script>
<script language="javascript" type="text/javascript">
function mess()
{
if (document.post.username.value.length<3)
{
alert("Your username cannot be less than 3 characters!");
document.post.username.focus();
return false;
} else if (document.post.fname.value=="")
{
alert("You forgot to enter your first name!");
return false;
} else if (document.post.lname.value=="")
{
alert("You forgot to enter your last name!");
return false;
} else if (document.post.city.value.length<3)
{
alert("The name of the city where you live cannot be less than 3 characters!");
document.post.city.focus();
return false;
}
}
function mess()
{
var pass1 = document.post.password1.value;
var pass2 = document.post.password2.value;
if (pass1 != pass2)
{
alert("Passwords did not match!");
return false;
}
if (pass1.length < 4)
{
alert("Your password cannot be less than 4 characters in length!");
return false;
}
return true; // Jag som antar...
}
function mess()
{
if (document.post.code.value.length<5)
{
alert("Your active code cannot be less than 5 characters!");
document.post.code.focus();
return false;
}
}
</script>
<script type="text/javascript">
function mess(){
if (document.post.username.value.length<3){
alert("Your username cannot be less than 3 characters!");
document.post.username.focus();
return false;
}
else if (document.post.fname.value==""){
alert("You forgot to enter your first name!");
return false;
}
else if (document.post.lname.value==""){
alert("You forgot to enter your last name!");
return false;
}
else if (document.post.city.value.length<3){
alert("The name of the city where you live cannot be less than 3 characters!");
document.post.city.focus();
return false;
}
else if (document.post.password1.value != document.post.password2.value){
alert("Passwords did not match!");
return false;
}
else if (document.post.password1.value.length<4){
alert("Your password cannot be less than 4 characters in length!");
return false;
}
else if (document.post.code.value.length<5){
alert("Your active code cannot be less than 5 characters!");
document.post.code.focus();
return false;
}
}
</script>
:)
271 ms totalt · 4 externa anrop · v20260731065814-full.6fe65c25