Nieuw lid |
|
Dit heb ik gevonden met googlen. maar hoe laat ik dit ajax functie aangestuurd worden?
in onclick, daar zal het volgens mij moeten komen, maar wat????
<? $_POST['binnen_gekomen'] = "true";?>
<script>
function datum(strURL)
{
var req = getXMLHTTP(); // fuction to get xmlhttp object
if (req)
{
req.onreadystatechange = function()
{
if (req.readyState == 4) { //data is retrieved from server
if (req.status == 200) { // which reprents ok status
document.getElementById('drop').innerHTML=req.responseText;
}
else
{
alert("There was a problem while using XMLHTTP:\n");
}
}
}
req.open("GET", strURL, true); //open url using get method
req.send(null);
}
}
<head>
<style type="text/css">
.style10 {
font-size: small;
}
</script>
</style>
</head>
<FORM style="position: absolute; width: 170px; height: 139px; z-index: 1; left: 782px; top: 0px;"
id="layer1" class="style3" name"zoeken" target="I1" method="POST"
action="../../loggedin/orders/order_zoekdatum.php"
style="width: 100px" class="style10">
<span class="style10">
<input type="checkbox" id="binnen_gekomen" name="binnen_gekomen" checked="checked"
onclick="if (this.checked!=true) { document.getElementById('verstuurd').checked=true }
else { document.getElementById('verstuurd').checked=false }" /></span> Ontvangen<br />
<span class="style10">
<input type="checkbox" id="verstuurd" name="verstuurd"
onclick="if (this.checked!=true) { document.getElementById('binnen_gekomen').checked=true }
else { document.getElementById('binnen_gekomen').checked=false }" /></span> Verzonden
<div id="drop">
<select name="zoekdatum" style="width: 110px">
<?
include ('dropfill.php');
?>
<input type="submit" name="zoeken" value="Zoeken">
</select></div>
</FORM>
<? $_POST['binnen_gekomen'] = "true";?> <script> function datum(strURL) { var req = getXMLHTTP(); // fuction to get xmlhttp object if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { //data is retrieved from server if (req.status == 200) { // which reprents ok status document.getElementById('drop').innerHTML=req.responseText; } else { alert("There was a problem while using XMLHTTP:\n"); } } } req.open("GET", strURL, true); //open url using get method req.send(null); } } <head> <style type="text/css"> .style10 { font-size: small; } </script> </style> </head> <FORM style="position: absolute; width: 170px; height: 139px; z-index: 1; left: 782px; top: 0px;" id="layer1" class="style3" name"zoeken" target="I1" method="POST" action="../../loggedin/orders/order_zoekdatum.php" style="width: 100px" class="style10"> <span class="style10"> <input type="checkbox" id="binnen_gekomen" name="binnen_gekomen" checked="checked" onclick="if (this.checked!=true) { document.getElementById('verstuurd').checked=true } else { document.getElementById('verstuurd').checked=false }" /></span> Ontvangen<br /> <span class="style10"> <input type="checkbox" id="verstuurd" name="verstuurd" onclick="if (this.checked!=true) { document.getElementById('binnen_gekomen').checked=true } else { document.getElementById('binnen_gekomen').checked=false }" /></span> Verzonden <div id="drop"> <select name="zoekdatum" style="width: 110px"> <? include ('dropfill.php'); ?> <input type="submit" name="zoeken" value="Zoeken"> </select></div> </FORM>
|