Search Results

Search found 933 results on 38 pages for 'autocomplete'.

Page 7/38 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • jQuery Autocomplete - Multicolumn and Return Data rather than Value

    - by MarkRobinson
    I am currently using the DevBridge jQuery Autocomplete plugin - it works fine as is, however I would like to display the returned information in a multi-column view, but yet when clicked only return the first value. HTML <form class="form" action="index.php" onsubmit="alert('Submit Form Event'); return false;"> <div id="selection"></div> <input type="text" name="q" id="query" class="textbox" /> </form> Javascript jQuery(function() { var options = { serviceUrl: '/autocompleterequestcall.php', maxHeight:400, width:600, fnFormatResult: fnFormatResult, deferRequestBy: 0 //miliseconds }; a1 = $('#query').autocomplete(options); }); So I expect I would need to use the fnFormatResult to somehow display the multicolumn values, which are separated by |, ie. REFERENCEID | POSTCODE | ADDRESS_LINE_1 | SURNAME I would have liked to wrap the whole return up as a <table> but I can't figure out where to put the start <table> and end </table> tags, or do I just replace | with </div><div>. Then, when an item is selected, instead of returning REFERENCEID | POSTCODE | ADDRESS_LINE_1 | SURNAME I would just like to see REFERENCEID

    Read the article

  • jquery ui autocomplete with database

    - by user301766
    I fairly new to JQuery and perhaps trying to achieve something that might be abit harder for a beginner. However I am trying to create an autocomplete that sends the current value to a PHP script and then returns the necessary values. Here is my Javascript code $("#login_name").autocomplete({ source: function(request, response) { $.ajax({ url: "http://www.myhost.com/myscript.php", dataType: "jsonp", success: function(data) { alert(data); response($.map(data, function(item) { return { label: item.user_login_name, value: item.user_id } })) } }) }, minLength: 2 }); And here is the the last half of "myscript.php" while($row = $Database->fetch(MYSQLI_ASSOC)) { foreach($row as $column=>$val) { $results[$i][$column] = $val; } $i++; } print json_encode($results); Which produces the following output [{"user_id":"2","user_login_name":"Name1"},{"user_id":"3","user_login_name":"Name2"},{"user_id":"4","user_login_name":"Name3"},{"user_id":"5","user_login_name":"Name4"},{"user_id":"6","user_login_name":"Name5"},{"user_id":"7","user_login_name":"Name6"}] Can anyone tell me where I am going wrong please? Starting to get quite frustrated. The input box just turns "white" and no options are shown. The code does work if I specify an array of values.

    Read the article

  • Jquery Autocomplete plugin with Django (Trey Piepmeier solution)

    - by Sally
    So, I'm basing my code on Trey's solution on: http://solutions.treypiepmeier.com/2009/12/10/using-jquery-autocomplete-with-django/ The script is: <script> $(function() { $('#id_members').autocomplete('{{ object.get_absolute_url }}members/lookup', { dataType: 'json', width: 200, parse: function(data) { return $.map(data, function(row) { return { data:row, value:row[1], result:row[0] }; }); } }).result( function(e, data, value) { $("#id_members_pk").val(value); } ); } ); </script> The views.py: def members_lookup(request, pid): results = [] if request.method == "GET": if request.GET.has_key(u'q'): value = request.GET[u'q'] # Ignore queries shorter than length 1 if len(value) > 2: model_results = Member.objects.filter( Q(user__first_name__icontains=value) | Q(user__last_name__icontains=value) ) results = [ (x.user.get_full_name(), x.id) for x in model_results ] json = simplejson.dumps(results) print json return HttpResponse(json, mimetype='application/json') The problem is: It stops refining the search results after the initial lookup. For example: If I set len(value) 2, after I type the 3rd character it will give me a list of suggestions. But if I keep on typing the 4th or 5th character, the list of suggestions doesn't change. Any suggestions on why this is?

    Read the article

  • Div click and AUTOCOMPLETE password dialog problem

    - by ticky
    And what if you want to autocomplete passwords? I am using similar thing here... I am using Div (id=loginButton) and it has some image - I don't want button control in MVC application (), neither image button. I have hidden input control which is hidden button actually (id=submit_btn). So, on div's (id=loginButton) click, I want to call hidden input control (id=submit_btn) and it's submit action. HTML: <div id="loginButton" > </div> <input type="submit" style="display:none" name="submit" id="submit_btn" /> And JQuery: $(document).ready(function() { $('#loginButton').click(function() { $('#LoginForm').submit(); }); $("form[action$='HandleLoginForm']").submit(function() { Login(); return false; }); return false; }); Function Login() is working with Ajax, without downloading file dialog, but I need also auto complete passwords dialog. function Login() { var urlData = $("#LoginForm").serialize(); if (returnUrl != "") { urlData = $("#LoginForm").serialize() + "&returnUrl=" + returnUrl; } $.ajax({ url: $("#LoginForm").attr("action"), type: "POST", data: urlData, dataType: "json", success: function(result) { if (result.Content != null) { if (result.Valid) { window.location = result.Content.toString(); } else { document.body.innerHTML = result.Content.toString(); } } } }); return false; } It is easy when you use only <input type="submit"> instead of DIV. Form knows that it is for auto completing passwords, but if I use div and force hidden button click like in the code from below, it doesn't show autocomplete password dialog. $('#submit_btn').click(); It will not work. User is logged in, but no reminding for browser to store password. I need this.

    Read the article

  • Jquery autocomplete webservices - what am i doing wrong??

    - by dzajdol
    I created a class for JSON responses: public class PostCodeJson { public String Text { get; private set; } public String Value { get; private set; } #region Constructors /// <summary> /// Empty constructor /// </summary> public PostCodeJson() { this.Text = String.Empty; this.Value = String.Empty; } /// <summary> /// Constructor /// </summary> /// <param name="_text"></param> /// <param name="_value"></param> public PostCodeJson(String _text, String _value) { this.Text = _text; this.Value = _value; } #endregion Constructors } and function returns list of this class using in webservices method: [WebMethod] public List<PostCodeJson> GetPostCodesCompletionListJson(String prefixText, Int32 count) { return LibDataAccess.DBServices.PostCodes.GetPostCodeJson(prefixText, count); } And in aspx i do this that: <script> $(document).ready(function() { $("#<%=pc.ClientID %>").autocomplete( baseUrl + "WebServices/Autocomplete.asmx/GetPostCodesCompletionListJson", { parse: function(data) { var array = new Array(); for (var i = 0; i < data.length; i++) { var datum = data[i]; var name = datum.Text; var display = name; array[array.length] = { data: datum, value: display, result: datum.Value }; } return array; }, dataType: "xml" }); }); </script> and when you enter something in the box i got an error: Request format is unrecognized for URL unexpectedly ending in '/GetPostCodesCompletionListJson What am I doing wrong??

    Read the article

  • twitter bootstrap typeahead ajax example

    - by emeraldjava
    I'm trying to find a working example of the twitter bootstrap typeahead element that will make an ajax call to populate it's dropdown. I have an existing working jquery autocomplete example which defines the ajax url to and how to process the reply <script type="text/javascript"> //<![CDATA[ $(document).ready(function() { var options = { minChars:3, max:20 }; $("#runnerquery").autocomplete('./index/runnerfilter/format/html',options).result( function(event, data, formatted) { window.location = "./runner/index/id/"+data[1]; } ); .. What do i need change to convert this to the typeahead example? <script type="text/javascript"> //<![CDATA[ $(document).ready(function() { var options = { source:'/index/runnerfilter/format/html', items:5 }; $("#runnerquery").typeahead(options).result( function(event, data, formatted) { window.location = "./runner/index/id/"+data[1]; } ); .. I'm going to wait for the 'Add remote sources support for typeahead' issue to be resolved.

    Read the article

  • Optimize LINQ Query for use with jQuery Autocomplete

    - by rockinthesixstring
    I'm working on building an HTTPHandler that will serve up plain text for use with jQuery Autocomplete. I have it working now except for when I insert the first bit of text it does not take me to the right portion of the alphabet. Example: If I enter Ne my drop down returns Nlabama Arkansas Notice the "N" from Ne and the "labama" from "Alabama" As I type the third character New, then the jQuery returns the "N" section of the results. My current code looks like this Public Sub ProcessRequest(ByVal context As System.Web.HttpContext) Implements System.Web.IHttpHandler.ProcessRequest ' the page contenttype is plain text' HttpContext.Current.Response.ContentType = "text/plain" ' store the querystring as a variable' Dim qs As Nullable(Of Integer) = Integer.TryParse(HttpContext.Current.Request.QueryString("ID"), Nothing) ' use the RegionsDataContext' Using RegionDC As New DAL.RegionsDataContext 'create a (q)uery variable' Dim q As Object ' if the querystring PID is not blank' ' then we want to return results based on the PID' If Not qs Is Nothing Then ' that fit within the Parent ID' q = (From r In RegionDC.bt_Regions _ Where r.PID = qs _ Select r.Region).ToArray ' now we loop through the array' ' and write out the ressults' For Each item In q HttpContext.Current.Response.Write(item & vbCrLf) Next End If End Using End Sub So where I'm at now is the fact that I stumbled on the "Part" portion of the Autocomplete method whereby I should only return information that is contained within the Part. My question is, how would I implement this concept into my HTTPHandler without doing a fresh SQLQuery on every character change? IE: I do the SQL Query on the QueryString("ID"), and then on every subsequent load of the same ID, we just filter down the "Part". http://www.example.com/ReturnRegions.axd?ID=[someID]&Part=[string]

    Read the article

  • Javascript autocomplete function href

    - by user896692
    I´ve the following javascript-function: <script type="text/javascript"> $(function() { var data = (<?php include("php/search_new.php"); ?>).Data.Recipes; var source = []; for (var i in data) { source.push({"href": "/php/get_recipe_byID.php?id=" + data[i].ID, "label": data[i].TITLE}); } $("#searchrecipes").autocomplete({ minLength: 3, source: source, select: function(event, ui) { window.location.href = ui.item.href; } }); }); </script> <input id="searchrecipes" type="text" name="searchrecipes" style="margin-left: 850px; margin-top: 0px; width:170px; background: #fff url(images/search_icon.png) no-repeat 100%;" onblur="this.style.background='#ffffff'; background: #fff url(images/search_icon.png) no-repeat 100%;" onfocus="this.style.background='#c40606'; background: url(images/search_icon.png) no-repeat 100%;" placeholder="Suchen..."></input> <input type="submit" name="buttonsenden" style="display:none;" value="" width: 5px></input> The function has already worked but suddenly it stopped working. The problem is, that the href on the dropdown-autocomplete isn´t clickable. var data = ({"Data":{"Recipes":{"Recipe_5":{"ID":"5","TITLE":"Spaghetti Bolognese"},"Recipe_7":{"ID":"7","TITLE":"Wurstel"},"Recipe_9":{"ID":"9","TITLE":"Schnitzel"},"Recipe_10":{"ID":"10","TITLE":null},"Recipe_19":{"ID":"19","TITLE":null},"Recipe_20":{"ID":"20","TITLE":"Hundefutter"},"Recipe_26":{"ID":"26","TITLE":"Apfelstrudel"},"Recipe_37":{"ID":"37","TITLE":null},"Recipe_38":{"ID":"38","TITLE":"AENDERUNG"},"Recipe_39":{"ID":"39","TITLE":null},"Recipe_40":{"ID":"40","TITLE":"Schnitzel"},"Recipe_42":{"ID":"42","TITLE":"Release-Test"},"Recipe_43":{"ID":"43","TITLE":"Wurstel2"}}},"Message":null,"Code":200}).Data.Recipes; All the necessary jquery scripts are available. What can be the problem?

    Read the article

  • JQuery Autocomplete Form Submission

    - by user1658370
    I have managed to implement the jQuery autocomplete plugin on my website but was wondering if it is possible to make the form auto-submit once the user selects an item from the search. I have the following set-up: HTML Form: <form class="quick_search" action="../include/search.php" method="post"> <input type="text" name="search" id="search" value="Search..."> </form> JavaScript: $().ready(function() { $("#search").autocomplete("../include/search.php", { width: 350, selectFirst: false }); }); I have also included the jQuery and Autoplugin scripts. The search.php file contains a list of the search options. At the moment, the search works correctly and I just need it to submit the form once an item is selected from the list that appears. I tried to use the onClick and onSelect options within the search field but neither of these worked correctly. Any help would be much appreciated (I don't really understand js)! Thanks.

    Read the article

  • Jquery UI autocomplete event change

    - by Stenly.k
    Hi I got a problem with change event. By documntation there should be object ui.item After an item was selected; ui.item refers to the selected item. Always triggered after the close event. But when I try it ui.item is undefined :( I want unset s_town_id when input in autocomplete doesn't match with data from script. Thx for any help. <input id="s_town" type="text" name="s_town" /> <input type="text" id="s_town_id" name="s_town_id" /> $(function() { $("#s_town").autocomplete({ source: function(request, response) { $.ajax({ url: "/_system/_ajax/uiautocomplete.php", dataType: "json", data: { name: "s_town", term: request.term }, success: function(data) { response($.map(data, function(item) { return { label: item.whisper_name+ " [" + item.zip_code + " / " + item.lup_state + "]", value: item.whisper_name, id: item.whisper_id, zip_code: item.zip_code, lup_state: item.lup_state, stateid: item.stateid } })) } }) }, minLength: 2, select: function(event, ui) { $("#s_town_id").val(ui.item.id); }, change: function(event, ui) { // ui.item is undefined :( where is the problem? $("#s_town_id").val(ui.item.id); } }); });

    Read the article

  • Slow loading jQuery Autocomplete

    - by Andrew G. Johnson
    Hi I am building an internal app for my company using jQuery's autocomplete and am finding it tends to start off very slow. My assumption is that the bottle neck is perhaps adding its elements to the DOM since after the first query it seems to be substantially speedier. Does anyone know of a way to pre-load these elements on page load instead of doing it for the first time when the user starts typing?

    Read the article

  • jquery autocomplete get hidden field value on keypress

    - by jacob
    i have a textbox. i have used jquery autocomplete to fill citynames and in the result handler i store the city id in the hidden field.now when user select option and press enters i have called this function onkeydown=" keyPress(event)". In this function i need hidden field value. but it is not set because the result handler is called after that. so how do i set/get hidden field value in keypress event.

    Read the article

  • Jquery autocomplete Items not clickable in mobile safari

    - by princyp
    I'm using the defualt jquery autocomplete plugin in my iphone web app, it builds a div with li's. In the browser the hovers and click events work for this but in mobile safari if I click it highlights the entire results containing div. Do I need to create seperate event listeners for the iphone? How would I go about doing this? thanks

    Read the article

  • What's a good AJAX Autocomplete Plugin for jQuery?

    - by Murat Ayfer
    I usually use jQuery as my JS library on my sites, and I would like to stick with it since I'm familiar with it. I need to implement an AJAX autocomplete, mainly for suggesting search results. Here are a few I have found: Dylan Verheul's version Jörn Zaefferer's version A modification of Dylan Verheul's version If you have tried any of these plugins, were you happy with them? Which one do you think is the most (and easily) customizable?

    Read the article

  • Redis autocomplete

    - by Alfred
    Hi, How can I implement an autocomplete using redis? Say for example I have an array ["alfred","joel","jeff","addick"]. When I type a I get ["alfred", "addick"] I hope you get the point. How can I implement this using redis commands efficiently(if possible but I think it is). It would be great if I could get some simple commands I can try out via telnet to mimic this behaviour. Thanks P.S: Merry x-mas to all of you :)

    Read the article

  • Tearing my hair out - ASP.Net AJAX AutoComplete not working

    - by Dave
    Hope someone can help with this. I've been up and down the web and through this site looking for an answer, but still can't get the Autocomplete AJAX control to work. I've gone from trying to include it in an existing site to stripping it right back to a very basic form and it's still not functioning. I'm having a little more luck using Page Methods rather than a local webservice, so here is my code <%@ Page Language="C#" AutoEventWireup="true" CodeFile="droptest.aspx.cs" Inherits="droptest" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <asp:ScriptManager ID="ScriptManager1" EnablePageMethods="true" runat="server"> </asp:ScriptManager> <cc1:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" MinimumPrefixLength="1" ServiceMethod="getResults" TargetControlID="TextBox1"> </cc1:AutoCompleteExtender> </form> </body> </html> using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.Script.Services; using System.Web.Services; public partial class droptest : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } [WebMethod] public string[] getResults(string prefixText, int count) { string[] test = new string[5] { "One", "Two", "Three", "Four", "Five" }; return test; } } Tried to keep things as simple as possible, but all I get is either the autocomplete dropdown with the source of the page (starting with the <! doctype...) letter by letter, or in IE7 it just says "UNDEFINED" all the way down the list. I'm using Visual Web Developer 2008 at the moment, this is running on Localhost. I think I've exhausted all the "Try this..." options I can find, everything from adding in [ScriptMethod] to changing things in Web.Config. Is there anything obviously wrong with this code? Only other thing that may be having an effect is in Global.asax I do a Context.RewritePath to rewrite URLs - does this have any effect on AJAX? Thanks for any help you can give.

    Read the article

  • Can you restrict entering an invalid entries with jquery ui autocomplete

    - by oo
    when using the jquery ui autocomplete, i would thought there would be an option to force only valid key entry based on the list. Is there anyway to not allow invalid keys so you can only enter valid items in the list? if my list has (csharp, java, python) i can start typing "abcds . ." and it lets me type it in. I want only valid entries to be allowed.

    Read the article

  • multiple word Predictive/autocomplete textarea?

    - by pablo
    Hi there I'm lookin for a javascript plugin (for js/any framework) I want to create a textarea that while I type will using a supplied data array, check for predictive matches to the current word im typing and try to suggest a solution. All solutions I've found so far (for jquery) only match one word, then end... I want to write like a sentence or paragraph but have autocomplete ability. Mockup image attached.

    Read the article

  • jquery autocomplete

    - by richzilla
    Does anyone know if theres a jquery autocomplete library that works similar to the one here: http://www.thetrainline.com (try and select a station to see what i mean) The one on here is a prototype library. Basically all the ones ive found will only match characters if they appear at the beginning of a string, for example, if i typed 'ear' it would not match the word 'hear'. However this one seems to do that. If anyone has any ideas id be very grateful.

    Read the article

  • jQuery UI Autocomplete plug-in pass in optional data for ajax call

    - by dev.e.loper
    I'm using jQuery UI Autocomplete plug-in. I'm giving it an URL to make an ajax call and retrieve data. I want to pass optional data parameters but not as part of URL. In the code they make a getJSON call and pass in 'request' parameter(which is an optional data parameter), however I don't see a way to get at this request parameter. this.source = function( request, response ) { $.getJSON( url, request, response ); };

    Read the article

  • Autocomplete problem

    - by Geetha
    Hi All, The autocomplete for a textbox is working when i am using the keyboard but it is not working for the button.[Userdefine keyboard for touch screen]. Geetha.

    Read the article

  • Disable autocomplete on textfield in Django?

    - by tau-neutrino
    Does anyone know how you can turn off autocompletion on a textfield in Django? For example, a form that I generate from my model has an input field for a credit card number. It is bad practice to leave autocompletion on. When making the form by hand, I'd add a autocomplete="off" statement, but how do you do it in Django and still retain the form validation?

    Read the article

  • Netbeans PHP autocomplete

    - by poru
    Hello, how could I add an autocomplete for PHP build-in functions like htmlentities or var_dump? The autocompleter work for my classes but there's not autocompletion for functions like mentioned above.

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >