Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- function showUser(str) {
- if (str == "") {
- document.getElementById("txtHint").innerHTML = "";
- return;
- } else {
- if (window.XMLHttpRequest) {
- // code for IE7+, Firefox, Chrome, Opera, Safari
- xmlhttp = new XMLHttpRequest();
- } else {
- // code for IE6, IE5
- xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
- }
- xmlhttp.onreadystatechange = function() {
- if (this.readyState == 4 && this.status == 200) {
- var myObj = JSON.parse(this.responseText);
- var horas = document.getElementsByClassName("hora");
- var i, x, bandeira = 0;
- for (x in myObj) {
- for (i = 0; i < horas.length; i++) {
- if (horas[i].value == myObj[x]) {
- horas[i].disabled = true;
- bandeira++;
- break;
- } else {
- horas[i].disabled = false;
- }
- }
- }
- //alert(this.responseText);
- }
- };
- xmlhttp.open("GET", "verificar_marcacao.php?q=" + str, true);
- xmlhttp.send();
- }
- }
- </script>
Add Comment
Please, Sign In to add comment