Search Results

Search found 23820 results on 953 pages for 'jquery ui autocomplete'.

Page 5/953 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • jQuery UI Dialog Button Icons

    - by Cory Grimster
    Is it possible to add icons to the buttons on a jQuery UI Dialog? I've tried doing it this way: $("#DeleteDialog").dialog({ resizable: false, height:150, modal: true, buttons: { 'Delete': function() { /* Do stuff */ $(this).dialog('close'); }, Cancel: function() { $(this).dialog('close'); } }, open: function() { $('.ui-dialog-buttonpane').find('button:contains("Cancel")').addClass('ui-icon-cancel'); $('.ui-dialog-buttonpane').find('button:contains("Delete")').addClass('ui-icon-trash'); } }); The selectors in the open function seem to be working fine. If I add the following to "open": $('.ui-dialog-buttonpane').find('button:contains("Delete")').css('color', 'red'); then I do get a Delete button with red text. That's not bad, but I'd really like that little trash can sprite on the Delete button as well.

    Read the article

  • Is there a way to force a user to select an autocomplete value before they can submit the form?

    - by Randy Johnson
    I am using the jqueryui autocomplete feature to allow the user to select their location. I need to make sure they select a location from the autocomplete before they can submit the form. I don't want them to be able to submit the form before they select a value. My solution is after they submit make sure that the value found is in the database. The other solution would be that when they click submit or after they leave the location box and go to another field to submit the entry via ajax to ensure it is valid if not show an error and do not let them submit the form. I was wondering if there was something easier I could do, or if there is something more elegant. I realize they have to be able to type something into the box to get the autocomplete to work, so I could force them to select a value from the autocomplete because it is not a select box, so it seems that my above solutions would be the best way to go. Thoughts?

    Read the article

  • Rails, JSON Object, jQuery, Auto-Complete

    - by Michael Waxman
    I'm using this jquery autocomplete plug-in with rails: http://docs.jquery.com/Plugins/Autocomplete I can't figure out how to format my results, both in my Rails controller and in my javascript file. I have something like this in my controller... @query = params[:q].downcase @json = User.all(:login => /^#{@query}/) respond_to do |format| format.js { render :json => @json.to_json(:only => "login"), :layout => false } end And then this in my script.js file... $("#form").autocomplete('/url', { width: 320, dataType: 'json', highlight: false, scroll: true, scrollHeight: 300 }) But I can't figure out how to parse the data, so my autocomplete just gets a raw array of all my results at once. How do I process the JSON in the script.js file and/or in my controller for it to work?

    Read the article

  • jQuery Autocomplete & jTemplates - handling response

    - by Diegos Grace
    Has anyone had any experience with using jTemplates to display autocomplete results. I have the following $("#address-search").autocomplete({ source: "/Address/SearchAddress", minLength: 2, delay: 400, focus: function (event, ui) { $('#address-search').val(ui.item.name); return false; }, parse: function(data) { $("#autocomplete-results").setTemplate($("#templateHolder").html()); $("#autocomplete-results").processTemplate(data); }, select: function (event, ui) { $('#address-search').val(ui.item.name); $('#search-address-id').val(ui.item.id); $('#search-description').html(ui.item.address); }); and the simple jtemplate holder: <script type="text/html" id="templateHolder"> <ul class="autocomplete"> {#foreach $T as data} <li>{$T.name}</li> {#/for} </ul> </script> Above i'm using 'Parse' to format results, I've also tried the autocomplete result method but not having any luck so far. The only success I've had is by using the private method ._renderItem and formatting the data that way but we want to render the output using the jTemplate. Any advice appreciated.

    Read the article

  • jQuery .ajax success function not rendering html with jQuery UI elements

    - by tylerpenney
    How do I have the html loaded into my div from the .ajax render with jquery? the success function loads the HTML, but those elements do not show up as jQuery UI elements, just the static HTML types. Any pointers? $(function() { $('input[type=image]').click(function(){ $.ajax({ url: '_includes/callinfo.php', data: 'id=' + $(this).attr('value'), dataType: "html", success: function(html){ $('#callwindow').html(html); } }); }); });

    Read the article

  • Pass variable by Post method from JQuery UI Autocomplete to PHP page

    - by Shahriar N Khondokar
    I have two JQuery UI autocomplete input fields. When an option is selected in the first one, the value of the selection will be used as condition for a database query that will send the source data for the second autocomplete field. My problem is how do I send the value of the first selection to the PHP page via Post method? The code so far is shown below (this code is from a tutorial which used the GET method; but I want to use Post): <script> $("input#divisions").autocomplete ({ //this is the first input source : [ { value: "81", label: "City1" }, { value: "82", label: "City2" }, { value: "83", label: "City3" } ], minLength : 0, select: function(event, ui) { $('#divisions').val(ui.item.label); return false; }, focus: function(event, ui){ $('#divisions').val(ui.item.label); return false; }, change: function(event, ui){ //the tutorial has this value sent by variables in the URL; I want the selection value sent by POST. How can I change this? c_t_v_choices = "c_t_v_choices.php?filter=" + ui.item.value; $("#c_t_v").autocomplete("option", "source", c_t_v_choices); } }).focus (function (event) { $(this).autocomplete ("search", ""); }); $("#c_t_v").autocomplete({ source: "", minLength: 2, select: function(event,ui){ //$('#city').val(ui.item.city); } }); </script> Can anyone please help? Dont hesitate to let me know if you have any questions.

    Read the article

  • JQUERY - jQuery UI Nested Sortables 2 - help getting it working

    - by nobosh
    Hello, I'm interested in using the following JQUERY - http://lucaswoj.com/2010/01/jquery-ui-nested-sortables-2/ However, I can't seem to get a demo instance of the plugin work. Here's the code I'm using: <script type="text/javascript"> $('#findit').nestedSortable({}); </script> <div > <ul id="findit"> <li> List Item Content <ul></ul> <li> <li> List Item Content 2 <ul></ul> <li> <li> List Item Content 3 <ul></ul> <li> <li> List Item Content 4 <ul></ul> <li> <ul> </div> Any ideas? Thanks

    Read the article

  • Error with jquery-autocomplete in rails

    - by alexBrand
    I've been trying to get autocomplete to work, however, I am getting a weird javascript error in the firebug console... I used the https://github.com/crowdint/rails3-jquery-autocomplete gem. The error I am getting reads: $(e).autocomplete is not a function Here are the scripts i am including in my html: <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script> <script src="/javascripts/autocomplete-rails.js?1294035084" type="text/javascript"></script> Thanks

    Read the article

  • Having Many Problems with Jquery UI 1.8.1 Dialog.js

    - by chobo2
    Hi I been using the jquery ui for quite a while now. This is the first time using 1.8 though and I am not sure why but it seems to me this plugin has taken steps backwards. I never had so much difficulty to use the Jquery UI as I am having now. First the documentation is out of date. Dependencies * UI Core * UI Draggable (Optional) * UI Resizable (Optional) After line 20mins of trying and getting error after error (like dialog is not a function) I realized that you need some other javascript file called "widget.js" So now I have Jquery 1.4.2.js UI Core.js UI Widget.js UI Dialog.js all on my page. I then did something like this $('#Delete').click(function () { var dialogId = "DeleteDialogBox"; var createdDialog = MakeDialogBox(dialogId, "Delete Conformation"); $('#tabConent').after(createdDialog); dialogId = String.format('#{0}', dialogId); $(dialogId).dialog({ resizable: true, height: 500, width: 500, modal: true, buttons: { 'Delete all items': function() { $(this).dialog('close'); }, Cancel: function() { $(this).dialog('close'); } } }); }); function MakeDialogBox(id, title) { var dialog = String.format('<div id="{0}" title="{1}"></div>', id, title); return dialog; } Now what this should be doing is it makes a where the dialog box should go. After that it should put it right after my tabs. So when watching it with firebug it does this. However once does the .dialog() method it moves the + all the stuff it generates and puts it after my footer. So now I have my dialog box under my footer tucked away in the bottom right hand corner. I want it dead in the center. In previous versions I don't think it mattered where the dialog code was on your page it would always be dead center. So what am I missing? The center.js(I don't know if this exists but seems like you need 100 javascript files now to get this to work proper).

    Read the article

  • jquery timer plugin

    - by Hulk
    the link specified below is a jquery timer plugin. http://keith-wood.name/countdown.html Also i use the following to start a timer $('#timer').countdown({until: 12,compact: true, description: ' to Go'}); My question is how do i deduce that the timer has reached 00:00:00 or the time given has elapsed Thanks..

    Read the article

  • Jquery dialog to open another page

    - by Hulk
    There is a page as transaction.html How to open this page in a popup in another page say show_transactions.html in a jquery dialog $dialog.html() //open transaction.html in this dialog .dialog({ autoOpen: true, position: 'center' , title: 'EDIT', draggable: false, width : 300, height : 40, resizable : false, modal : true, }); alert('here'); $dialog.dialog('open'); This code is present in show_transactions.html Thanks..

    Read the article

  • How to change Jquery UI Slider handle

    - by Tom
    I want to modify the stock JQuery UI slider so that the handle has a arrow on it rather than being a square. i.e. I want to use a custom image as the handle. There are a few tutorials that do it: http://jqueryfordesigners.com/slider-gallery/ http://www.ryancoughlin.com/2008/11/04/using-the-jquery-ui-slider/ http://www.keepthewebweird.com/creating-a-nice-slider-with-jquery-ui/ But I can't get it to work. The following code results in a stationary handle image: <!DOCTYPE html> <html> <head> <link type="text/css" href="http://jqueryui.com/latest/themes/base/ui.all.css" rel="stylesheet" /> <script type="text/javascript" src="http://jqueryui.com/latest/jquery-1.3.2.js"></script> <script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.core.js"></script> <script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.slider.js"></script> <style type="text/css"> #myhandle {position: absolute;z-index: 100;height: 25px;width: 35px;top: auto;background: url(http://stackoverflow.com/content/img/so/vote-arrow-down.png) no-repeat;} </style> <script type="text/javascript"> $(document).ready(function(){ $("#slider").slider({handle: '#myhandle'}); }); </script> </head> <body> <div id="slider"><div id="myhandle"></div></div> </body> </html> It is as if JQuery doesn't pick up that I want to use the myhandle id for the handle. I'm wondering: Do I need a plugin for JQuery to recognise the handle option? (it is not documented in http://docs.jquery.com/UI/Slider). Or perhaps it only worked in an old version of JQuery? Any ideas?

    Read the article

  • JQuery Autocomplete - Stop mouseover+Return submitting data

    - by ILT
    I'm using JQuery Autocomplete (bassistance) and have run into a problem. If the mouse rolls over one of the autocomplete suggestions and the user hits the return key (rather than clicking to make selection), the form is submitted and goes to whatever link was rolled over at the time. This is a problem as people click in the textbox, and when typing their search, leave the pointer where the autocomplete popup appears. So when they hit enter, it doesn't do the search for whatever they typed in the box but whatever was highlighted in the autocomplete suggestions. Is there a way to stop this? Using Google as the functionality I'm after... So just to clarify - I want selections via mouse and keyboard to go to the same place, but if the UP or DOWN arrow has not been pressed (user not selected an autocomplete option via the keyword), dont go to the URL specified in the autosuggest - instead submit the form (traditional method without JQuery) based on what has been typed in the textbox. I hope I'm explaining this clearly? :S

    Read the article

  • Jquery ui autocomplete different source

    - by voidnull
    Hi i try to use jquery ui autocomplete. I have different autocomplete field in one page and i need to get data with different sources (different url) depend to wich autocomplete field is used. i know how can i get the typed data (request.term), but i cant find the way to get the selected field ID. $(".ac").autocomplete({ source: function(request, response) { id = '??? the actually used field #id ???'; $.ajax({ type: "POST", url: "/admin_/sql/autocomplete/"+id, data: "test=...", async: false, success: function(data) { } }); }, search: function() { // }, focus: function() { // return false; }, select: function(event, ui) { // return false; } });

    Read the article

  • ASP.Net MVC 2 Auto Complete Textbox With Custom View Model Attribute & EditorTemplate

    - by SeanMcAlinden
    In this post I’m going to show how to create a generic, ajax driven Auto Complete text box using the new MVC 2 Templates and the jQuery UI library. The template will be automatically displayed when a property is decorated with a custom attribute within the view model. The AutoComplete text box in action will look like the following:   The first thing to do is to do is visit my previous blog post to put the custom model metadata provider in place, this is necessary when using custom attributes on the view model. http://weblogs.asp.net/seanmcalinden/archive/2010/06/11/custom-asp-net-mvc-2-modelmetadataprovider-for-using-custom-view-model-attributes.aspx Once this is in place, make sure you visit the jQuery UI and download the latest stable release – in this example I’m using version 1.8.2. You can download it here. Add the jQuery scripts and css theme to your project and add references to them in your master page. Should look something like the following: Site.Master <head runat="server">     <title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title>     <link href="../../Content/Site.css" rel="stylesheet" type="text/css" />     <link href="../../css/ui-lightness/jquery-ui-1.8.2.custom.css" rel="stylesheet" type="text/css" />     <script src="../../Scripts/jquery-1.4.2.min.js" type="text/javascript"></script>     <script src="../../Scripts/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script> </head> Once this is place we can get started. Creating the AutoComplete Custom Attribute The auto complete attribute will derive from the abstract MetadataAttribute created in my previous post. It will look like the following: AutoCompleteAttribute using System.Collections.Generic; using System.Web.Mvc; using System.Web.Routing; namespace Mvc2Templates.Attributes {     public class AutoCompleteAttribute : MetadataAttribute     {         public RouteValueDictionary RouteValueDictionary;         public AutoCompleteAttribute(string controller, string action, string parameterName)         {             this.RouteValueDictionary = new RouteValueDictionary();             this.RouteValueDictionary.Add("Controller", controller);             this.RouteValueDictionary.Add("Action", action);             this.RouteValueDictionary.Add(parameterName, string.Empty);         }         public override void Process(ModelMetadata modelMetaData)         {             modelMetaData.AdditionalValues.Add("AutoCompleteUrlData", this.RouteValueDictionary);             modelMetaData.TemplateHint = "AutoComplete";         }     } } As you can see, the constructor takes in strings for the controller, action and parameter name. The parameter name will be used for passing the search text within the auto complete text box. The constructor then creates a new RouteValueDictionary which we will use later to construct the url for getting the auto complete results via ajax. The main interesting method is the method override called Process. With the process method, the route value dictionary is added to the modelMetaData AdditionalValues collection. The TemplateHint is also set to AutoComplete, this means that when the view model is parsed for display, the MVC 2 framework will look for a view user control template called AutoComplete, if it finds one, it uses that template to display the property. The View Model To show you how the attribute will look, this is the view model I have used in my example which can be downloaded at the end of this post. View Model using System.ComponentModel; using Mvc2Templates.Attributes; namespace Mvc2Templates.Models {     public class TemplateDemoViewModel     {         [AutoComplete("Home", "AutoCompleteResult", "searchText")]         [DisplayName("European Country Search")]         public string SearchText { get; set; }     } } As you can see, the auto complete attribute is called with the controller name, action name and the name of the action parameter that the search text will be passed into. The AutoComplete Template Now all of this is in place, it’s time to create the AutoComplete template. Create a ViewUserControl called AutoComplete.ascx at the following location within your application – Views/Shared/EditorTemplates/AutoComplete.ascx Add the following code: AutoComplete.ascx <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> <%     var propertyName = ViewData.ModelMetadata.PropertyName;     var propertyValue = ViewData.ModelMetadata.Model;     var id = Guid.NewGuid().ToString();     RouteValueDictionary urlData =         (RouteValueDictionary)ViewData.ModelMetadata.AdditionalValues.Where(x => x.Key == "AutoCompleteUrlData").Single().Value;     var url = Mvc2Templates.Views.Shared.Helpers.RouteHelper.GetUrl(this.ViewContext.RequestContext, urlData); %> <input type="text" name="<%= propertyName %>" value="<%= propertyValue %>" id="<%= id %>" class="autoComplete" /> <script type="text/javascript">     $(function () {         $("#<%= id %>").autocomplete({             source: function (request, response) {                 $.ajax({                     url: "<%= url %>" + request.term,                     dataType: "json",                     success: function (data) {                         response(data);                     }                 });             },             minLength: 2         });     }); </script> There is a lot going on in here but when you break it down it’s quite simple. Firstly, the property name and property value are retrieved through the model meta data. These are required to ensure that the text box input has the correct name and data to allow for model binding. If you look at line 14 you can see them being used in the text box input creation. The interesting bit is on line 8 and 9, this is the code to retrieve the route value dictionary we added into the model metada via the custom attribute. Line 11 is used to create the url, in order to do this I created a quick helper class which looks like the code below titled RouteHelper. The last bit of script is the code to initialise the jQuery UI AutoComplete control with the correct url for calling back to our controller action. RouteHelper using System.Web.Mvc; using System.Web.Routing; namespace Mvc2Templates.Views.Shared.Helpers {     public static class RouteHelper     {         const string Controller = "Controller";         const string Action = "Action";         const string ReplaceFormatString = "REPLACE{0}";         public static string GetUrl(RequestContext requestContext, RouteValueDictionary routeValueDictionary)         {             RouteValueDictionary urlData = new RouteValueDictionary();             UrlHelper urlHelper = new UrlHelper(requestContext);                          int i = 0;             foreach(var item in routeValueDictionary)             {                 if (item.Value == string.Empty)                 {                     i++;                     urlData.Add(item.Key, string.Format(ReplaceFormatString, i.ToString()));                 }                 else                 {                     urlData.Add(item.Key, item.Value);                 }             }             var url = urlHelper.RouteUrl(urlData);             for (int index = 1; index <= i; index++)             {                 url = url.Replace(string.Format(ReplaceFormatString, index.ToString()), string.Empty);             }             return url;         }     } } See it in action All you need to do to see it in action is pass a view model from your controller with the new AutoComplete attribute attached and call the following within your view: <%= this.Html.EditorForModel() %> NOTE: The jQuery UI auto complete control expects a JSON string returned from your controller action method… as you can’t use the JsonResult to perform GET requests, use a normal action result, convert your data into json and return it as a string via a ContentResult. If you download the solution it will be very clear how to handle the controller and action for this demo. The full source code for this post can be downloaded here. It has been developed using MVC 2 and Visual Studio 2010. As always, I hope this has been interesting/useful. Kind Regards, Sean McAlinden.

    Read the article

  • JQUERY, Compare two Text Blocks, and then animate only the new text

    - by nobosh
    I have two blocks of text Text Block 1 - Currently displayed on the page: "Ahd Hd ahaSdjdajs dadjs jasd adskadskl1lksad klasd klasd dsa Ahd Hd ahaSdjdajs dadjs jasd adskadskl1lksad klasd klasd dsa Ahd Hd ahaSdjdajs dadjs jasd adskadskl1lksad klasd klasd dsa Ahd Hd ahaSdjdajs dadjs jasd adskadskl1lksad klasd klasd dsa" But now Block 1 on the backend is: "Ahd Hd ahaSdjdajs dadjs jasd adskadskl1lksad klasd klasd dsa Ahd Hd ahaSdjdajs dadjs jasd adskadskl1lksad klasd klasd dsa Ahd Hd ahaSdjdajs dadjs jasd adskadskl1lksad klasd klasd dsa Ahd Hd ahaSdjdajs dadjs jasd adskadskl1lksad klasd klasd dsaadskadskl1lksad klasd klasd dsa Ahd Hd ahaSdjdajs dadjs jasdadskadskl1lksad klasd klasd dsa Ahd Hd ahaSdjdajs dadjs jasd adskadskl1lksad klasd klasd dsa Ahd Hd ahaSdjdajs dadjs jasd adskadskl1lksad klasd klasd dsaadskadskl1lksad klasd klasd dsa Ahd Hd ahaSdjdajs dadjs jasdadskadskl1lksad klasd klasd dsa Ahd Hd ahaSdjdajs dadjs jasd adskadskl1lksad klasd klasd dsa Ahd Hd ahaSdjdajs dadjs jasd adskadskl1lksad klasd klasd dsaadskadskl1lksad klasd klasd dsa Ahd Hd ahaSdjdajs dadjs jasd adskadskl1lksad klasd klasd dsaadskadskl1lksad klasd klasd dsa Ahd Hd ahaSdjdajs dadjs jasd adskadskl1lksad klasd klasd dsaadskadskl1lksad klasd klasd dsa Ahd Hd ahaSdjdajs dadjs jasd adskadskl1lksad klasd klasd dsa" I'd like to update the original Block 1 that's on the page, with the Block 2 that's on the server to the page. And I'd like to append, and not flash the entire block. So only the new stuff is flashed. Any ideas on how to do this in JQUERY?

    Read the article

  • Drag and drop not working while using JQuery UI dialog

    - by user327854
    Hi Guys ! I m using jquery ui.core.js with version 1.7.2 and jquery-1.4.2.js . I got the issue saying "proto.plugins"(query ui.core.js for draggable module) is undefined ,hence i am not able to perform the drag option.My Code is given below. $("#linkfortag").click(function(){ var $dialog=$("<div id='testing'></div>").dialog({autoOpen:false}); $dialog.dialog("destroy"); $dialog.draggable(); alert("$dialog is" + $dialog.html()); $dialog.dialog('open'); $dialog.dialog({title:'Add Tag',resizable:true,closeOnEscape:true,modal:true,minWidth:250,buttons:{ 'Add Tag':function() { alert($(this).children().children().children(':input').attr('value')); var value=$("#addTag").attr('value'); var formobj=$(this).children(); validate_usertagform(value); } ,'Cancel': function() {$(this).dialog('close');}}}); $dialog.bind("dialogbeforeclose",function(event,ui){ alert("Dialog is gng to close"); alert("<<<<<<<<<<<<<<<<<UI IS>>>>>>>>>>>>>>>>>>>>>>" + ui); }); $dialog.bind("drag",function(event,ui){ alert("<<<<<<<<<<<<<<<<<drag is>>>>>>>>>>>>>" + event); }); $dialog.dialog( "option", "closeText", '' ); $dialog.dialog("option","draggable",true); }); Please help me on this........

    Read the article

  • JQuery Mobile: Fire Mobileinit Event

    - by Yousef_Jadallah
     Many people asked that the Mobileinit event didn't work. Simplicity just you need to follow this sequence: <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.css" />     <script src="http://code.jquery.com/jquery-1.6.1.min.js"></script>     <script>         $(document).bind("mobileinit", function () {             alert('mobileinit is fired');         });     </script>     <script src="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.js"></script> Hope that helps.  

    Read the article

  • Extending jQuery with jQuery.Extend

    - by Jalpesh P. Vadgama
    We all know that jQuery is a great JavaScript framework. It’s provide lots of functionalities and most used framework in programming world. But sometimes we need a functionality that does not provided by jQuery by default. At that time we need to extend jQuery. We can extend jQuery with jQuery.Extend  Method. You can get complete information from the following link. http://api.jquery.com/jQuery.extend/ It merges the contents of two or more objects together into the first object. More on my personal blog @www.dotnetjalps.com

    Read the article

  • jQuery AutoComplete (jQuery UI 1.8rc3) with ASP.NET web service

    - by user296640
    Currently, I have this version of the autocomplete control working when returning XML from a .ashx handler. The xml looks like this: <?xml version="1.0" encoding="UTF-8" standalone="no" ?> <States> <State> <Code>CA</Code> <Name>California</Name> </State> <State> <Code>NC</Code> <Name>North Carolina</Name> </State> <State> <Code>SC</Code> <Name>South Carolina</Name> </State> The autocomplete code looks like this: $('.autocompleteTest').autocomplete( { source: function(request, response) { var list = []; $.ajax({ url: "http://commonservices.qa.kirkland.com/StateLookup.ashx", dataType: "xml", async: false, data: request, success: function(xmlResponse) { list = $("State", xmlResponse).map(function() { return { value: $("Code", this).text(), label: $("Name", this).text() }; }).get(); } }); response(list); }, focus: function(event, ui) { $('.autocompleteTest').val(ui.item.label); return false; }, select: function(event, ui) { $('.autocompleteTest').val(ui.item.label); $('.autocompleteValue').val(ui.item.value); return false; } }); For various reasons, I'd rather be calling an ASP.NET web service, but I can't get it to work. To change over to the service (I'm doing a local service to keep it simple), the start of the autocomplete code is: $('.autocompleteTest').autocomplete( { source: function(request, response) { var list = []; $.ajax({ url: "/Services/GeneralLookup.asmx/StateList", dataType: "xml", This code is on a page at the root of the site and the GeneralLookup.asmx is in a subfolder named Services. But a breakpoint in the web service never gets hit, and no autocomplete list is generated. In case it makes a difference, the XML that comes from the asmx is: <?xml version="1.0" encoding="utf-8" ?> <string xmlns="http://www.kirkland.com/"><State> <Code>CA</Code> <Name>California</Name> </State> <State> <Code>NC</Code> <Name>North Carolina</Name> </State> <State> <Code>SC</Code> <Name>South Carolina</Name> </State></string> Functionally equivalent since I never use the name of the root node in the mapping code. I haven't seen anything in the jQuery docs about calling a .asmx service from this control, but a .ajax call is a .ajax call, right? I've tried various different paths to the .asmx (~/Services/), and I've even moved the service to be in the same path to eliminate these issues. No luck with either. Any ideas?

    Read the article

  • jQuery autocomplete: taking JSON input and setting multiple fields from single field

    - by Sly
    I am trying to get the jQuery autocomplete plugin to take a local JSON variable as input. Once the user has selected one option from the autocomplete list, I want the adjacent address fields to be autopopulated. Here's the JSON variable that declared as a global variable in the of the HTML file: var JSON_address={"1":{"origin":{"nametag":"Home","street":"Easy St","city":"Emerald City","state":"CA","zip":"9xxxx"},"destination":{"nametag":"Work","street":"Factory St","city":"San Francisco","state":"CA","zip":"94104"}},"2":{"origin":{"nametag":"Work","street":"Umpa Loompa St","city":"San Francisco","state":"CA","zip":"94104"},"destination":{"nametag":"Home","street":"Easy St","city":"Emerald City ","state":"CA","zip":"9xxxx"}}}</script> I want the first field to display a list of "origin" nametags: "Home", "Work". Then when "Home" is selected, adjacent fields are automatically populated with Street: Easy St, City: Emerald City, etc. Here's the code I have for the autocomplete: $(document).ready(function(){ $("#origin_nametag_id").autocomplete(JSON_address, { autoFill:true, minChars:0, dataType: 'json', parse: function(data) { var rows = new Array(); for (var i=0; i<=data.length; i++) { rows[rows.length] = { data:data[i], value:data[i].origin.nametag, result:data[i].origin.nametag }; } return rows; } }).change(function(){ $("#street_address_id").autocomplete({ dataType: 'json', parse: function(data) { var rows = new Array(); for (var i=0; i<=data.length; i++) { rows[rows.length] = { data:data[i], value:data[i].origin.street, result:data[i].origin.street }; } return rows; } }); }); }); So this question really has two subparts: 1) How do you get autocomplete to process the multi-dimensional JSON object? (When the field is clicked and text entered, nothing happens - no list) 2) How do you get the other fields (street, city, etc) to populate based upon the origin nametag sub-array? Thanks in advance!

    Read the article

  • jquery plus minus sign on collaps and expand

    - by user295189
    hi I am using the code below. What I wanted is to have a + or - sign on expanded or collapsed view. How can I do that. Here is the code Thanks in advance! XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX <!--//---------------------------------+ // Developed by Roshan Bhattarai | // http://roshanbh.com.np | // Fell Free to use this script | //---------------------------------+--> <title>Collapsible Message Panels</title> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ //hide the all of the element with class msg_body $(".msg_body").show(); //toggle the componenet with class msg_body $(".msg_head").click(function(){ $(this).next(".msg_body").slideToggle(100); }); }); </script> <style type="text/css"> body { margin: 10px auto; width: 570px; font: 75%/120% Verdana,Arial, Helvetica, sans-serif; } p { padding: 0 0 1em; } .msg_list { margin: 0px; padding: 0px; width: 383px; } .msg_head { padding: 5px 10px; cursor: pointer; position: relative; background-color:#FFCCCC; margin:1px; } .msg_body { padding: 5px 10px 15px; background-color:#F4F4F8; } </style> </head> <body> <div align="center"> <p>Click on the each news head to toggle </p> </div> <div class="msg_list"> <p class="msg_head">Header-1 </p> <div class="msg_body"> orem ipsum dolor sit amet, consectetuer adipiscing elit orem ipsum dolor sit amet, consectetuer adipiscing elit </div> <p class="msg_head">Header-2</p> <div class="msg_body"> orem ipsum dolor sit amet, consectetuer adipiscing elit orem ipsum dolor sit amet, consectetuer adipiscing elit </div> </div> </body> </html>

    Read the article

  • jQuery Autocomplete with _renderItem and catagories

    - by LillyPop
    As a newb to jQuery im wondering if its possible to have both jQuery _renderItem (for custom list item HTML/CSS) AND the categories working together in harmony? Ive got my _renderItem working great but I have no idea how to incorporate categories into the mix. My code so far $(document).ready(function () { $(':input[data-autocomplete]').each(function () { $(':input[data-autocomplete]').autocomplete({ source: $(this).attr("data-autocomplete") }).data("autocomplete")._renderItem = function (ul, item) { var MyHtml = "<a>" + "<div class='ac' >" + "<div class='ac_img_wrap' >" + '<img src="../../uploads/' + item.imageUrl + '.jpg"' + 'width="40" height="40" />' + "</div>" + "<div class='ac_mid' >" + "<div class='ac_name' >" + item.value + "</div>" + "<div class='ac_info' >" + item.info + "</div>" + "</div>" + "</div>" + "</a>"; return $("<li></li>").data("item.autocomplete", item).append(MyHtml).appendTo(ul); }; }); }); The jQuery documentation for the autocomplete gives the following code example : $.widget("custom.catcomplete", $.ui.autocomplete, { _renderMenu: function (ul, items) { var self = this, currentCategory = ""; $.each(items, function (index, item) { if (item.category != currentCategory) { ul.append("<li class='ui-autocomplete-category'>" + item.category + "</li>"); currentCategory = item.category; } self._renderItem(ul, item); }); } }); Id like to get my custom HTML (_renderItem) and categories working together, can anyone help me to merge these two together or point me in the right direction. Thanks

    Read the article

  • JQuery autocomplete problem

    - by heffaklump
    Im using JQuerys Autocomplete plugin, but it doesn't autocomplete upon entering anything. Any ideas why it doesnt work? The basic example works, but not mine. var ppl = {"ppl":[{"name":"peterpeter", "work":"student"}, {"name":"piotr","work":"student"}]}; var options = { matchContains: true, // So we can search inside string too minChars: 2, // this sets autocomplete to begin from X characters dataType: 'json', parse: function(data) { var parsed = []; data = data.ppl; for (var i = 0; i < data.length; i++) { parsed[parsed.length] = { data: data[i], // the entire JSON entry value: data[i].name, // the default display value result: data[i].name // to populate the input element }; } return parsed; }, // To format the data returned by the autocompleter for display formatItem: function(item) { return item.name; } }; $('#inputplace').autocomplete(ppl, options); Ok. Updated: <input type="text" id="inputplace" /> So, when entering for example "peter" in the input field. No autocomplete suggestions appear. It should give "peterpeter" but nothing happens. And one more thing. Using this example works perfectly. var data = "Core Selectors Attributes Traversing Manipulation CSS Events Effects Ajax Utilities".split(" "); $("#inputplace").autocomplete(data);

    Read the article

  • Why my autocomplete doesn't whant to be multiple ???

    - by Toni Michel Caubet
    please, give me a hand on this one; i'm trying to use autocomplete so user can enter tags by comma separated, example: 'autocomplete, jquery , next , last' ok, i had the autocomplete working by sending him an $array with all the tags of my website with the previous format aswell, this is my code: <? $a = new etiqueta(0, ''); $b = $a->autocomplete_etiquetas(); mostrar_notificacion('autocomplete_etiquetas_cargado?'); ?> <script type="text/javascript"> function cargar_autocomplete_etiquetas(){ $("#tags").autocomplete({ source: [<? echo $b; ?>] }); } </script> All i want it's user to select a tag, apply the ', ' and the autocomplete to be ready for next tag i'm trying with (i know they are diff id's, also diff inputs): <? $b = new ingrediente(0, ''); $c = $b->autocomplete_ingredientes(); ?> <script type="text/javascript"> function cargar_autocomplete_ingredientes(){ $("#ingredientes").autocomplete({ source: [<? echo $c; ?>], multiple: true, multipleSeparator: ", " }); } </script> But with out success.... 10€ via paypal if answered before 23h (its 21:50 now), it's not much, it's an incentive :P

    Read the article

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