Function is not working
Function is not working
Hi, I try to write this function
- 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
- <form action="{$smarty.const._URL}/search.php" method="get" id="search" name="grabber" onsubmit="return validateGrabber(this);">
- <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} />
- <input name="btn" value="{$lang.submit_search}" type="submit" class="search_bttn" />
- <div class="suggestionsBox" id="suggestions" style="display: none;">
- <div class="suggestionList" id="autoSuggestionsList">
- </div>
- </div>
- </form>
I try to make a grabber which takes the data from ajax_grabber.php