```
<script>
    function loadXMLDoc() {
        $("input[class=search]").bind("keyup",function(){
            $.get("search.php?search="+$(this).val(), 
                  function(data){
                      if(data==1) {
                          alert("this is valid search")
                      } else {
                          alert("this is a right user search");
                      }
                  }
            );
        });
    }
</script>

```

Below is the button image code

```
<table width="165" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td>
            <img src="images/search_box_left_im.png" width="3" height="28" />
        </td>
        <td class="inputbox_bg" width="118px">
            <input type="text" name="search" class="username">
        </td>
        <td>
            <input type="image" onclick="loadXMLDoc()" src="images/search_go_btn.png" border="0" width="44" height="28" />
        </td>
    </tr>
</table>

```

It is going to the function but not executing the ajax code