babbelut
Legacy Member
werkt niet perfect dus, zitten fouten op de pagina, maar krijg ze er niet uit
html file:
js file:
html file:
HTML:
<html>
<head>
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<script>Navibar()</script>
<form name="check_form" method="post">
Geef uw e-mailadres: <br>
<input type="text" name="email"></input><br>
Geef uw postcode: <br>
<input type:"text" name="postcode"></input><br>
<input type="button" name="submit" value="submit" onClick="check()">
</form>
</body>
</html>
js file:
PHP:
function Navibar()
{
document.write('<a href= "../labo2/labo2.html">' + 'ga naar labo 2' + '</a>');
document.write(' | ');
document.write('<a href= "../labo3/labo3.html">' + 'ga naar labo 3' + '</a>');
document.write(' | ');
document.write('<a href= "../labo4/labo4.php">' + 'ga naar labo 4' + '</a>');
document.write(' | ');
document.write('<a href= "../index.html">' + 'ga naar beginpagina' + '</a>');
}
function check()
{
var formulier = document.check_form;
var email= formulier.email.value;
var postcode= formulier.postcode.value;
var e= true;
var p= true;
if ( email.indexOf('@')==-1 || (email.indexOf('<')!=-1 && email.indexOf('>')!=-1) )
{
e = false;
}
if (postcode.length!=4 || !isDigit(postcode) || (postcode.indexOf('<')!=-1 && postcode.indexOf('>')!=-1))
{
p = false;
}
if (e == true && p == true)
{
document.write("balba");
}
else
{
alert("De gegevens zijn fout");
}
}