/    Sign up×
Community /Pin to ProfileBookmark

Form validation

My form validation doesn’t work.
It used to work.

function controle(form) {
var bln=false;
var TotStr = “Volgende items zijn verplicht:nrn”;

if ( form._1_naam.value.length == 0 )
{
TotStr = TotStr + “achternaamnr”;
bln = true;
}

if ( form._2_voornaam.value.length == 0)
{
TotStr = TotStr + “voornaamnr”;
bln = true;
}

if ( form._5_straat.value.length == 0)
{
TotStr = TotStr + “straatnr”;
bln = true;

}

if ( form._9_postcode.value.length == 0)
{
TotStr = TotStr + “postcodenr”;
bln = true;

}

if ( form._8_stad.value.length == 0)
{
TotStr = TotStr + “gemeentenr”;
bln = true;

}

if ( form._11_land.value.length == 0)
{
TotStr = TotStr + “landnr”;
bln = true;

}

if ( form._12_tel.value.length == 0)
{
TotStr = TotStr + “telefoonnummernr”;
bln = true;
}
if ( form._
15_info[0].checked ){
if ((form._16_type[0].checked)||(form._16_type[1].checked)||(form._16_type[2].checked)||(form._16_type[3].checked)||(form._16_type[4].checked)||(form._16_type[5].checked)||(form._16_type[6].checked)){
}else{
TotStr = TotStr + “Type professionalnr”;
bln = true;
}
}

if ( form._100_email.value.length == 0)
{
TotStr = TotStr + “email adresnr”;
bln = true;
}

if (bln) {
alert ( TotStr );
return false;
} else {
return true;
}

}

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@DiedtjeauthorFeb 25.2005 — It seems that he's thinking that all the fields are filled.
×

Success!

Help @Diedtje spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...