Crew .NET |
|
Mogelijk voorbeeld, maar voor jouw project moet je het wel nog aanpassen!
<html>
<head>
<title>Uren test</title>
<script type="text/javascript">
function checkHours()
{
var uren = document.getElementById("txtUren").value;
if (uren < 8)
{
var div = document.getElementById("extraField");
var txt = document.createElement("input");
txt.setAttribute("type", "text");
txt.setAttribute("id", "txtReden");
var btn = document.createElement("input");
btn.setAttribute("type", "submit");
btn.setAttribute("id", "btnReden");
btn.setAttribute("value", "OK!");
div.appendChild(txt);
div.appendChild(btn);
}
else
{
alert("uren in orde");
}
}
</script>
</head>
<body>
<input type="text" id="txtUren" />
<input type="button" id="btnUren" value="OK" onclick="checkHours()" />
<br />
<div id="extraField">
</div>
</body>
</html>
<html> <head> <title>Uren test</title> <script type="text/javascript"> function checkHours() { var uren = document.getElementById("txtUren").value; if (uren < 8) { var div = document.getElementById("extraField"); var txt = document.createElement("input"); txt.setAttribute("type", "text"); txt.setAttribute("id", "txtReden"); var btn = document.createElement("input"); btn.setAttribute("type", "submit"); btn.setAttribute("id", "btnReden"); btn.setAttribute("value", "OK!"); div.appendChild(txt); div.appendChild(btn); } else { alert("uren in orde"); } } </script> </head> <body> <input type="text" id="txtUren" /> <input type="button" id="btnUren" value="OK" onclick="checkHours()" /> <br /> <div id="extraField"> </div> </body> </html>
|