w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
jQuery ui autocomplete no search results
When using like you need to enclose the value within quotes. e.g. tValue like '%my_value%'. Note the use of single quotes in the following (I'm only showing the lines that need to be updated): In your mysqli: $mysqli->query("SELECT * FROM Tag_T WHERE tValue LIKE '%".$search."%' ORDER BY tValue ASC") and in your PDO: $ac_term = "'%".$_GET['term']."%'"; Update: If you've already tried this then please add some error handling so that you can narrow down the source of the problem. For mysqli (http://php.net/manual/en/mysqli.error.php): $queryTags = $mysqli->query("SELECT * FROM Tag_T WHERE tValue LIKE %".$search."% ORDER BY tValue ASC"); if (!$queryTags) { printf("Error: %s", mysqli_error($mysqli)); } while($row = mysqli_fetch_array($queryTags)) { $results[] = array(

Categories : PHP

(jQuery-Autocomplete) Show all the results after clearing search box
You will need to add this option to require 0 chars to activate the search: minLength: 0 With this enabled you can just hit the down-arrow and the list will show EDIT: Now that I understand the problem better you will likely need to add the "search" option The search option fires before anything is requested from the source so it is an optimal place to see if the field is empty or not. ,search: function(event, ui){ if($(this).val() == ''){ //code to show table } } You can also use the change option but in my experience it only fire upon a change in the value or more closely when the field fires a blur event so I do not personally enjoy its' behavior in my application ,change: function(event, ui){ if($(this).val() =

Categories : Jquery

how to change type ajax call to controller of option "serviceUrl" in ajax autocomplete jquery devbridge with CodeIgniter?
I fixed my problems, but data that contains values for callback function when data is selected always null. What's up? MY SCRIPT: var options, a; $(document).ready(function(){ options = { serviceUrl:'controller_name/function_test', onSelect: function(suggestion) { alert('You selected ' + suggestion.value + ', ' + suggestion.data); } }; a = $('#search_by_user').autocomplete(options); }); MY FUNCTION IN CONTROLLER : public function function_test() { $query = isset($_GET['query']) ? $_GET['query'] : FALSE; //$query = 'te'; if($query) { $found = $this->model_name->get_list($query); $suggestions = array(); $data = array(); foreach($found as $row) {

Categories : Codeigniter

Optimizing Search: no results returned for phrase search
What about this kind of thing : $query = "SELECT * FROM files WHERE ('".$searchText."' LIKE concat('%',keywords,'%')) OR (keywords LIKE '%".$searchText."%') ORDER BY website, description ASC";

Categories : PHP

Do not select returned item in jquery autocomplete?
Look at the categories example for Autocomplete. You can make your message a type of category header, and as such it wouldn't be selectable by the user. http://jqueryui.com/autocomplete/#categories The example works by implement their own _renderMenu method. I've done this and it wasn't too hard, but it did require a newer version of jQuery to work.

Categories : Javascript

Search-by-tag results returned on a single line
The problem is this line: var txt = $(selector).text().replace(searchTermRegEx, '<span class="match">$1</span>'); You are not preserving the html tags that are part of the original text. When you retrieve .text(), you are getting a result that has all of the tags removed. To fix this, you just need to use the html of the text instead: var txt = $(selector).html().replace(searchTermRegEx, '<span class="match">$1</span>');

Categories : Jquery

Ordering an SQL query using returned results from a sub query
I'm confused by your query, the select statement you are ordering by will return the same results for every student, because it's not related to the students_info table. I assume you want something like this: SELECT tb1.stud_id , tb1.stud_name , SUM(tb2.score) AS total_marks FROM Students_info AS tb1 LEFT JOIN scores AS tb2 ON tb1.stud_id = tb2.student_id GROUP BY tb1.stud_id , tb1.stud_name ORDER BY total_marks DESC

Categories : Mysql

No Results returned for ROW_NUMBER() query
I'm thinking RowNum 1 may not have a date between your selections. Maybe put the date selection inside so that you know that the first one matches. SELECT Referer FROM (SELECT ROW_NUMBER() OVER (ORDER BY CT.Referer ASC) AS RowNum, CT.Referer, CT.LastModified FROM ClickTrack CT JOIN OrderTrack OT ON OT.ClickTrackID = CT.ClickTrackID WHERE CT.LastModified BETWEEN '07/06/2013' and '08/05/2013' GROUP BY CT.Referer, CT.LastModified HAVING LEN(CT.Referer) > 0) as num WHERE RowNum = 1

Categories : Misc

Results not being returned for MongoDB query in PHP
What version of PECL mongo lib are you using? if >= 1.3.0 (we are now on 1.4.3 stable), the Mongo class is deprecated and you are encouraged to use MongoClient instead. Please refer to phpDoc.

Categories : PHP

limit results returned by distinct query
Should this suffice? Event.executeQuery("select distinct e from Event as e inner join e.performances as p where p.dateCreated is not null order by p.dateCreated desc", [max: 5]) If you also need performances corresponding to each event in the same query, you can use inner join fetch.

Categories : Hibernate

how to display jquery autocomplete results
You need to add a "select" event handler to extract the selected value. Like so: $( "#tags" ).autocomplete({ source: availableTags, select: function(event, ui) { // console.log(ui.item); $('p').text('You selected: ' + ui.item.value); } });

Categories : Jquery

Comparing results returned by query SQLite database
The only thing I see, is that you don't close the cursor. Do something like so: Cursor c = null; try { /* your stuff in here */ } finally { if (c != null) c.close(); }

Categories : Java

Jquery Autocomplete Search Box
Often your encoding is wrong. Try this: PHP - format special characters and display UTF-8 should display everything in the right way. Sometimes special fonts dont support every sign. So perhaps take a look there.

Categories : Jquery

jquery autocomplete result as two results from json/php
Have you tried using JSON.parse to convert your JSON string into a JavaScript object? Then you can use it as you wish.

Categories : Jquery

How to use the jQuery UI Autocomplete plug-in to search?
Looking at the api: http://api.jqueryui.com/autocomplete/#event-select You have access to the select event. $( ".search_box" ).autocomplete({ source: availableTags, select: function( event, ui ) { console.log(ui); // you can see output of this in your dev console var searchTerm = ui.item; // pretty sure item will give you what you want // you can then trigger your button click or form submit (whatever you're doing) // passing along the searchTerm $('.top_bar_search').find('form').submit(); } });

Categories : Jquery

How to get jquery autocomplete values to search?
As shown in the documentation the source property could point to a remote endpoint that will return the data: <script type="text/javascript"> $('.search_box').autocomplete({ source: '/remote.php' }); </script>

Categories : Jquery

How to display HTML in jQuery autocomplete results in Rails
Unless you declare your string as HTML-safe, it will always be escaped for you. This is a safety mechanism. The most straight-forward method is to employ html_safe on the tags: def get_label(firstname, lastname) [ '<b>', h([ firstname, lastname ].join(' '))), '</b>' ].join('').html_safe end Even better, you can use the helper methods to construct tags for you: def get_label(firstname, lastname) content_tag('b', [ firstname, lastname ].join(' ')).html_safe end The second approach is better since you're not running the risk of accidentally declaring the name html_safe.

Categories : Ruby

jQuery: Remove ui-autocomplete styles from dropdown results
Credit goes to Claustrofob for providing me the CSS to remove all styles off jquery-ui's autocomplete: .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active, .ui-autocomplete, .ui-autocomplete:hover, .ui-menu-item, .ui-menu-item:hover, .ui-menu-item a, .ui-menu-item a:hover, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-menu .ui-menu-item a.ui-state-focus, .ui-menu .ui-menu-item a.ui-state-active, .ui-menu .ui-menu-item a { background: #ffffff none no-repeat; padding:0; margin:0; display:block; border:0;border-collapse:collapse; }

Categories : Jquery

How to set limit to jQuery mobile autocomplete to display on 10 results
slice your result var result=//your result in array results.slice(0, 10)); // by this only 10 results come reference slice

Categories : Jquery

How to customize the jquery autocomplete search mechanism
Duplicate any values in data that have white-space with the same entry with only the label being different (without white-space). var data = [ {"url":"http://site/test.php", "label":" test course"}, {"url":"http://site/test.php", "label":" testcourse"} ]; Here's a way you can loop through data and add any items that are not the same when you strip out white-spaces: for(i = 0; i < data.length; i++){ var noWhsp = data[i].label.replace(/s/g, ''); if(data[i].label !== noWhsp){ data.push({"url":data[i].url, "label":noWhsp}) } }

Categories : Jquery

jQuery Autocomplete returns all results (json) no matter what I write
More information on my comment. Please refer to the autocomplete documentation. http://api.jqueryui.com/autocomplete/#option-source Here is the key part, emphasis mine. String: When a string is used, the Autocomplete plugin expects that string to point to a URL resource that will return JSON data. It can be on the same host or on a different one (must provide JSONP). The Autocomplete plugin does not filter the results, instead a query string is added with a term field, which the server-side script should use for filtering the results. For example, if the source option is set to "http://example.com" and the user types foo, a GET request would be made to http://example.com?term=foo. The data itself can be in the same format as the local data described above.

Categories : Jquery

How to have SQL query results returned and stored in localhost window variable, rather than the terminal, using Node.js?
Node (and all servers) work based on client requests and server responses. When the client makes a request for certain information, the server detects the request, (in this case runs the query), and then serves the response. If you want the client to get records in javascript, you have to serve a JSON representation back to the client. A great tool for making requests and responses simpler is Express.js Let me know if you want some code samples.

Categories : Mysql

jquery autocomplete suggestion trigger search button
You should set the value to the form input before submitting. If you don't, your form is submitted before it has a chance to populate the input. Something like : $("#tags").autocomplete({ source: availableTags select: function (event, ui) { //Set the value $(this).val(ui.item.value); // Submit the form $('#IDofMYform').submit(); } });

Categories : Javascript

jquery multi autocomplete with remote source, showing the results on focus
This helped me: var showSuggestions = function() { var searchString = extractLast(this.value); if (searchString.trim().length == 0) { searchString = "[GetAll]"; } $(this).autocomplete("search", searchString); }; $(this).focus(showSuggestions).click(showSuggestions); And on the sever I am checking if it is [GetAll] I consider this is empty string

Categories : Jquery

jquery autocomplete - need enter key to process current search phrase
You can try something like: function sendSelected(_val){ var search_input = _val; if (search_input =='') search_input ='*'; var dataString = 'keyword='+search_input; if (search_input.length > 2 || search_input=='*') { $.ajax({ type: "GET", url: "core/functions/searchdata.php", data: dataString, success: function(server_response) { $('#searchresultdata').empty(); $('#searchresultdata').append(server_response); $('span#category_title').html(search_input); } }); } } $("#SearchPhrase").keypress(function(e) { if(e.keyCode == 13) { e.preventDefault(); sendSelected(this.value); $(this).autocomplete('close'); } });

Categories : Jquery

Search Query don't show results
You were not actually processing the result of your query. You have to fetch each row from the returned result set and then use the fields returned in your html output. Try this:- if (isset($_POST['search'])) { $searchq = $_POST['search']; $searchq = preg_replace("#[^0-9a-z]#i", "", $searchq); $query = mysql_query( "SELECT * FROM tReference WHERE sReference LIKE '%$searchq%' OR sSearch LIKE '%$searchq%' OR sSort LIKE '%$searchq%'") or die("La Recherche est impossible"); if (mysql_num_rows($query) == 0) { $output = "Aucun Résultat Pour Cette Recherche!"; //English Trans : No results have been Found! } else { $output .= '<div><ul>'; while ( $row = mysql_fetch_object($q

Categories : PHP

Making A Search Query And Getting Results
This is a quite big question with lots of small ones inside. First, the way to communicate between server and client is mostly based on RESTful webservices. But, it really depends on your use cases and needs. The same applies to your question regarding the "right tools". What skills do you have? Which dependencies do you have? What is your target audience? So, it is quite hard to give you "the one and only" answer...

Categories : Web Services

GAE Search API Query with "Date = YYYY-MM-DD" returns no results
Looks like your date is stored not only with year-month-day info but with hours, minutes, seconds and miliseconds. There can be two solutions: Make sure you are set not year-month-day part to zero Search by range: date >= currentDay && date < nextDay

Categories : Java

How to get jquery autocomplete to display only terms that begin with the typed query
With the new version of jQuery autocomplete when you use a URL as a source (like you do): You must return JSON data: String: When a string is used, the Autocomplete plugin expects that string to point to a URL resource that will return JSON data. It can be on the same host or on a different one (must provide JSONP). The GET argument you receive is 'term', not 'q' The Autocomplete plugin does not filter the results, instead a query string is added with a term field, which the server-side script should use for filtering the results. The proper way to use real escape with mySQL in PHP is to use it after the connection has been established, in your case: $q = $_GET['term']; $mysqli = mysqli_connect('localhost','username','password','languages'); if (!$mysqli or $mysqli->

Categories : PHP

Youtube API - API search results differ from web search results, and no partial matches?
In the web you are searching the entire channel (not only the uploads playlist but all the playlists inside the channel) vs in the second one you restrict the search with uploads playlist. I also strongly suggest to use Data API v3 instead of GData

Categories : Android

Linq returned results as condition to another linq query
after query_1; var firstOwner = query_1.FirstOrDefault() ?? string.Empty; then in query_2, assuming m (db.tableD) has an OwnerName property... where m.OwnerName = firstOwner; Version 2, If you need an OwnerId from query_1 : change it to select new { OwnerName = m.OwnerName, OwnerId = m.OwnerId }; than var firstOwner = query_1.FirstOrDefault(); var firstOwnerId = firstOwner == null ? -1 : firstOwner.OwnerId; and in query_2 where m.OwnerId = firstOwnerId;

Categories : C#

Number of results from elasticserch fuzzy_like_this_field influence "good" results being returned
I think you might have some misapprehensions about the fuzzy_like_this query. Fuzzifies ALL terms provided as strings and then picks the best n differentiating terms...For each source term the fuzzy variants are held in a BooleanQuery with no coord factor... If you just want a fuzzy search based on Levenshtein distance, use a fuzzy query

Categories : Python

JQuery dynamic search results not working
This is working code I have tried it in Fiddle and it works Try to search 25x in input box you will find the output. Updated May be there are some zero-width spaces between your code, I check and I got Error in your code like, Uncaught SyntaxError: Unexpected token ILLEGAL Reference Chrome Uncaught Syntax Error: Unexpected Token ILLEGAL And if you rewrite above code like, $(function(){ var $cells = $("td"); $("#search").keyup(function() { var val = $.trim($(this).val()).toUpperCase(); if (val === "") $cells.parent().show(); else { $cells.parent().hide(); $cells.filter(function() {return -1 != $(this).text().toUpperCase().indexOf(val);}).parent().show(); } }); }) Then I found it works

Categories : Javascript

javascript jquery expand collapse search results
You are adding your event listener to the click event of any h2 elements that are present on page load. It sounds like you are then loading in new content and expecting the same code to work for them. Instead, you will need to do this: $("body").on("click","h2",function(){ $(this).toggleClass("open"); $(this).next().toggle(); }); Which will work on any h2 that is on the page. If you want only h2s in a certain container to have the effect then replace body for a reference to that element EDIT: I see now that you are using quite an old version of jQuery that doesn't support the on() function. I would suggest upgrading if you can, or use Abhishek Saha's answer if you cannot.

Categories : PHP

jquery not fetching results from json based on search input?
Move your code to fetch JSON into your event handler. Your code execute directly upon occurence, so it does not find any value on the input box. $("#search-json-submit").click(function(){ var url = "json.php"; var search_query = jQuery('#search-json-input').val(); var search_query_regex = new RegExp(".*"+search_query+".*", "g"); $.getJSON(url, function (data) { users = data.members; renderRow(idx); $('#next').click(function() { idx++; renderRow(idx); }); $('#previous').click(function() { idx--; renderRow(idx); }); }); //... Rest of the handler });

Categories : PHP

Getting full address of returned location from geo-autocomplete api
I'm not sure what you mean by "geo-autocomplete plugin", but when you mean the places-autocomplete, you must observe the place_changed event of the autocomplete-instance (which fires when the user selects a place from the dropdown). Inside the callback you may access the placesResult by using this.getPlace(), formatted_address is (when available) a property of the placeRsult, so you may retrieve it by using this.getPlace().formatted_address Sample-code: google.maps.event.addListener(autocomplete, 'place_changed', function() { var address = this.getPlace().formatted_address||''; alert(address); });

Categories : C#

jQuery autocomplete remote data using getJson with autocomplete.filter
You should only use the "filter" if your data is locally stored. If it is remote, you should filter it on the server side first before sending it over. From the jQuery UI documentation: The Autocomplete plugin does not filter the results, instead a query string is added with a term field, which the server-side script should use for filtering the results. For example, if the source option is set to "http:// example.com" and the user types foo, a GET request would be made to http:// example.com?term=foo. The data itself can be in the same format as the local data described above. http://api.jqueryui.com/autocomplete/ Your first example works well for this scenario.

Categories : Jquery

Load Ajax content of faceted search results in jQuery Colorbox
First, this is not ajax... Second, even without ajax, the problem lies in your colorbox config, as you are passing a URL to the colorbox without giving the URL a place to live, such as an iframe. You need first to write a constructor to build your query URL for the conventional post, and then expand your colorbox properties to include the colorbox iframe property, as below. $(document).ready(function(){ $(".show-overlay-link").click(function() { // get facet name from value of @id var id = $(this).attr("id"); // modify the returned id to remove the unwanted part of the id // for use in the query constructor var facetName = id.replace(/^show-overlay-link-/, ""); // build a query constructor for your query URL var facetQuery =

Categories : Jquery

How do I run autocomplete directly from the server instead of the default JQuery UI autocomplete?
Jquery auto-completer gives you the option to load the data from server. Checkout this link http://jqueryui.com/autocomplete/#remote

Categories : Jquery

search box or autocomplete text box for search UL list
var sources = []; $('span').each(function(i,ele){ sources.push({'label': $(ele).text(), 'value' : i}); }); $( "#tags" ).autocomplete({ source: sources }); Untidy JSFIDDLE

Categories : Javascript



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.