Function is not working

Function is not working

Hi, I try to write this function

  1. function grabber(inputGrabber) {

        if(inputGrabber.length == 0) {

            // Hide the suggestion box.

            $('#suggestions').hide();

        } else if(inputGrabber.length > 2) {

            $.post(MELODYURL2+'/ajax_grabber.php', {queryString: ""+inputGrabber+""}, function(data){

                if(data.length >0) {

                    $('#suggestions').show();

                    $('#autoSuggestionsList').html(data);

                }

            });

        }

    } // end ajax grabber
























and this is my form code

  1.                 <form action="{$smarty.const._URL}/search.php" method="get" id="search" name="grabber" onsubmit="return validateGrabber(this);">
  2.                 <input name="keywords" type="text" value="" class="search_keywords" id="inputGrabber" {if $smarty.const._SEARCHSUGGEST == 1}onkeyup="grabber(this.value);" onblur="fill();" autocomplete="off"{/if}  /> 
  3.                 <input name="btn" value="{$lang.submit_search}" type="submit" class="search_bttn" />
  4.                 <div class="suggestionsBox" id="suggestions" style="display: none;">
  5.                     <div class="suggestionList" id="autoSuggestionsList">
  6.                     </div>
  7.                 </div>
  8. </form>  
I try to make a grabber which takes the data from ajax_grabber.php