[jQuery] Re: Autocomplete plugin: results as table?
it's great indeed :) On Wed, Oct 14, 2009 at 10:34, Maarten maartenwie...@gmail.com wrote: On 12 okt, 18:35, alexbodn.gro...@gmail.com wrote: hello maarten, your attempt sounds interesting. could you give public access to these urls? Hello Alex, Sure, apparently some server settings were changed in the weekend but you can now access my demo at: http://public.blackpearl.minus3.nl/autocompleter/demo/table.html -- Maarten -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: Autocomplete plugin: results as table?
hello maarten, your attempt sounds interesting. could you give public access to these urls? On Wed, Oct 7, 2009 at 18:08, Maarten maartenwie...@gmail.com wrote: http://autocompleter.mwierda.blackpearl.minus3.nl/demo/table.html type in 'c' for a grouped result, using a TABLE for the layout. its mostly the fillList that's altered, see: http://autocompleter.mwierda.blackpearl.minus3.nl/jquery.autocomplete.js please let me know if this was helpful or if there are any comments. On Oct 6, 10:38 am, Maarten maartenwie...@gmail.com wrote: FYI: I looked into the source of the autocomplete script and I think I'm gonna try to extend it myself. -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: Autocomplete - How to simulate a select box, where displayed value is one thing and submitted value is another
you need a hidden field to hold the value, and play around with the result trigger. hth On Mon, Oct 5, 2009 at 23:16, benze ebenza...@gmail.com wrote: Hi, I'm trying to figure out how to use the autocomplete jQuery plugin best to my needs. I'm looking to replace a select box with the Autocomplete plugin, but not quite sure how to accomplish this. In my select box, I have the option that is displayed is not the same as the data that is submitted. ex: option value=123This is Displayed /option However, with the autocomplete, since it is using a textbox, the values that are displayed, are submitted. Do I have to hack around using hidden fields to accomplish this type of behaviour? Thanks, Eric -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: (autocomplete) help about extraparams
please try cacheLength=0 arg to autocomplete. On Fri, Oct 2, 2009 at 03:45, Otniel Zebua otn...@gmail.com wrote: Ok, I have got it with $_GET. But now I have another problem, if I choose England for the country, then I press a in autocomplete input box, then $_GET['country'] value will be GB in the server-side code. But when I choose Italy for the country, then I press a again in autocomplete input box then $_GET['country'] value will be also GB in the server-side code. But If I press b then $_GET['country'] value will be IT in server-side code. Am I doing something wrong, or there is a bug in the script? Looks like, the cache was still there. How can I clear the cache. Thanks again for your help. Regards, On Fri, Oct 2, 2009 at 8:24 AM, James james.gp@gmail.com wrote: Yep. In my experience, I think the only time I found it not to send any extra param is if the value of the param is empty (or undefined, I believe). In the example, if: $(#country).val(); returns nothing. pragard, You might want to try to test it with a hard-coded value: extraParams: { country: function() { return 'USA'; } } -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: [autocomplete] auto complete based on additional input value
hello frank, your application knows what's the zip of each hospital, so i think there's not worth sending it and expecting it back. what you probably need is to take the zip from another field supplied by the user, and base the query upon it. that's extraParam for. the key part is the variable passed, and the value may be the value to give it, i.e. {zipfield: $('#zipfield').val()}. the data you pass th the autocomplete may be a list of hospital names, or any other format, if you supply a parse function also. On Fri, Sep 25, 2009 at 06:30, Frank elun...@gmail.com wrote: I'm using one of the examples from the demo files as a template. Basically I'd like to auto suggest hospitals based on the zip code that's entered from another input. Can someone recommend how do accomplish this? TIA This is the local data set: var hospitals = [ { name: hospital 1, zip: 1}, { name: hospital 2, zip: 2}, { name: hospital 3, zip: 3}, { name: hospital 4, zip: 4}, { name: hospital 5, zip: 5}, ... and here's the autocompleter: script $(document).ready(function(){ $(#example).autocomplete(hospitals, { matchContains: word, max: 8, width: 500, scrollHeight: 300, extraParams: { return 1; }, formatItem: function(row, i, max) { return row.name + em (zip code: + row.zip + )/em; }, formatMatch: function(row, i, max) { return row.name; }, formatResult: function(row) { return row.name; } }); }); /script input id=zipcode / input id=example / -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: [autocomplete] Does it support version 1.3.2?
sure :) On Sat, Sep 19, 2009 at 04:31, Catherine catherinek@gmail.com wrote: Same as subject I'm having trouble using it with jQuery 1.3.2. Please advice. -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: Deterministic or Non-Deterministic Event Handler execution?
event driven programs can't usually rely on the order they might run. but in the case they both handle the same event or predictable event sequence, you may have handler for one event [conditionally] trigger the other event or even invoke it's handler directly. just my thought :) . On Sat, Sep 19, 2009 at 00:56, Dr Stevens daverstev...@gmail.com wrote: Is it acceptable to assume that Event Handlers are excecuted in the order they are bound? I just wanted to hear what peoples thoughts were on this. Lets say I have two plugins which both bind an event handler to the form submit event. In order for them to co-exist, one of the event handlers would need to execute first. In other languages and platforms I would consider making this kind of assumption to be bad practice. I would think the ideal thing to do would be to support callbacks (or better yet, custom events) similar to the validate plugin. I'd love to hear peoples thoughts on this. -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: [autocompleter] how to change the separator from , to +
On Wed, Sep 16, 2009 at 11:17, James spidman...@gmail.com wrote: but where should I put it? as an additional argument to autocomplete(). On Sep 13, 5:47 pm, alexbodn.gro...@gmail.com wrote: multipleSeparator='+' On Sun, Sep 13, 2009 at 14:22, James spidman...@gmail.com wrote: hey, let me first thank for the great job you've done. could you please tell me how can I change the word separator from , to +? thanks in advance. -- alex smime.p7s 1KViewDownload -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: Handling result from the autocomplete plugin
look at the parse function and maybe provide another parse function suitable for your data format. the result trigger will be able to update other fields when you select your choice. On Sun, Sep 13, 2009 at 00:45, Althalos g...@ekdahlproduction.com wrote: Hello I'm using the following autocomplete plugin: http://docs.jquery.com/Plugins/Autocomplete It's getting its data from an array, here are the first couple of values: data[0] = Magnesium (s) | R: 11, 15 | S: 7/8, 43; data[1] = Saltsyra 4M (aq) | R: 36/38 | S: 2. 28; data[2] = Natriumnitrat | NaNO3 | R: 8, 22; I have four different input elements: - Name, which triggers the autocomplete - three other ones When the user enters something in name and the choses one of the autosuggested lines, I don't want it to put that entire name into the input window. I to ONLY put the name into it, the name is always the first part of the string, the part before the first |. Then I want to put the information between the first | and the second | into the second input box, the information between the second and third | into the third box, and the information left in the string I want to put into a fourth input element. How can this easiest be achieved? -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: Autocomplete plugin - customization
if i understand you correctly, using the result trigger (google for it) may do the whole job. On Mon, Sep 14, 2009 at 11:27, Althalos g...@ekdahlproduction.com wrote: Hi I'm trying to make a custom hack to the autocomplete plugin. I want it so that when you select a suggestion I can separate the data in that suggestion and insert parts of it into four different elements. I'll use split to get the data into an array and then use the Val function to set the values of the elements, but what is the easiest way to customize theplugon like this? Can I do this wihout editing the plugn itself? -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: [autocompleter] how to change the separator from , to +
multipleSeparator='+' On Sun, Sep 13, 2009 at 14:22, James spidman...@gmail.com wrote: hey, let me first thank for the great job you've done. could you please tell me how can I change the word separator from , to +? thanks in advance. -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: Autocomplete -- Autofill Comma Seperator Issues
try to remove the highlight flag, so you'll have a better idea on what's going on. On Mon, Sep 14, 2009 at 03:13, Mil formboardem...@wdoenterprises.com wrote: Wow, how did I miss that option. Thanks Patrick. On Sep 7, 9:18 am, Patrick Wolf patrick.wolf...@gmail.com wrote: Hi, have you tried to set the option selectFirst to false? Regards Patrick On Sep 3, 8:15 am,Milformboardem...@wdoenterprises.com wrote: Does anyone have any ideas for this issue? On Sep 1, 4:49 am,Milformboardem...@wdoenterprises.com wrote: Hi, I am trying to use thisautocompletehttp://docs.jquery.com/Plugins/Autocomplete but I'm having some issues with it. I'm trying to create a simple tag autocompletefeature. This is what I want to type (Example 1) TextArea: Cake, Ca, Caldren, Calimari, This is what I get (Example 2) TextArea: Cake, Cake, Caldren, Calimari, In Javascript, my var data = [Cake, Caldren, Calimari]; As you can see, I cannot type Ca because the information will autofillto Cake every time I type acomma. The only way I can avoid this is to do something very un-user friendly. That is to type Ca then press space and then type mycomma. That's the only way I can do it to make Example 1 work. This is my code: jQuery(#TagBox).autocomplete(data, { multiple: true, highlight: false, multipleSeparator: , }); What am I doing wrong? -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: [autocomplete] Autocomplete selection with mouse causes blur while with keyboard doesn't
result is being triggered with null values when the list gets shown onchange of input value. On Sat, Sep 12, 2009 at 08:36, Joel D'Souza joeldso...@gmail.com wrote: I intend to use the blur function when a selection is not made to clear some hidden field values. And the result function to set/update those hidden fields when a selection is made. With the mouse selection, as both blur and result are triggered simultaneously, a race condition occurs. This problem doesn't exist with the keyboard selection. Any solutions? Thanks in advance. -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: [Autocomplete] Receiving data in XML
hi, i'm personally not the maintainer of autocomplete, but in my opinion this code is too purpose specific to be hardwired in autocomplete. but you could pass a function with the part in else as the 'parse' argument to autocomplete, and need no change in autocomplete itself. On Fri, Sep 11, 2009 at 18:32, Joao Gilberto Magalhaes joaogilbertomagalh...@gmail.com wrote: Hi, Basically to work like I said before I make the follow changes in AutoComplete v1.1 (full file is attached) function parse(data) { var parsed = []; if (!options.xmlResult) { var rows = data.split(\n); for (var i=0; i rows.length; i++) { var row = $.trim(rows[i]); if (row) { row = row.split(|); parsed[parsed.length] = { data: row, value: row[0], result: options.formatResult options.formatResult(row, row[0]) || row[0] }; } } } else { var count = 0; $(data).find(options.xmlResult).each(function() { var aux = []; aux[0] = $(this).html(); for(i=0;ioptions.xmlAttrNodes.length;i++) { aux[i+1] = $(this).attr(options.xmlAttrNodes[i]); } parsed[count++] = { data: aux, value: aux[0], result: options.formatResult options.formatResult(aux, aux[0]) || aux[0] }; }); } return parsed; }; and did this inside the $.Autocompleter.defaults declaration xmlResult: false, xmlAttrNodes: [id, value], So, Is this code OK to be incorporated to future releases of the Autocomplete plugin? Thanks in advanced. 2009/9/10 alexbodn.gro...@gmail.com play with the options to autocomplete: dataType, parse are handling the conversation with the server. On Wed, Sep 9, 2009 at 16:11, Joao Gilberto joaogilbertomagalh...@gmail.com wrote: Hi, First of all, I want to thank you about your excellent Autocomplete plugin for jQuery. So, I plan use your component in my open source framework called XMLNuke. This framework produces XML, so I made some changes in jQuery Autocomplement plugin to support receive XML data. Here an Example: $(#teste3).autocomplete(demo/search.php, { width: 260, selectFirst: false, xmlResult: value, xmlAttrNodes: [ id, info ] }); The XML looks like to: rootnode value id=1 info=Some Info 1Some Description 1/value value id=2 info=Some Info 2Some Description 2/value value id=3 info=Some Info 3Some Description 3/value /rootnode How do I attach the file with the changes in Plugin? -- alex -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: [Autocomplete] Receiving data in XML
jQuery('#x').autocomplete(.,parse=function(data){parse the data with same resulting format as parse(data) in autocomplete}, ...); On Fri, Sep 11, 2009 at 23:37, Joao Gilberto Magalhaes joaogilbertomagalh...@gmail.com wrote: Hi Alex, Thanks for your quick response. There is one item about parse XML in the autocomplete TODO document, so my intention is help the project. But, in fact I prefer use a solution with no change in autocomplete. Could you give a rough sample about HOW I implement this? Thank you again. 2009/9/11 alexbodn.gro...@gmail.com hi, i'm personally not the maintainer of autocomplete, but in my opinion this code is too purpose specific to be hardwired in autocomplete. but you could pass a function with the part in else as the 'parse' argument to autocomplete, and need no change in autocomplete itself. On Fri, Sep 11, 2009 at 18:32, Joao Gilberto Magalhaes joaogilbertomagalh...@gmail.com wrote: Hi, Basically to work like I said before I make the follow changes in AutoComplete v1.1 (full file is attached) function parse(data) { var parsed = []; if (!options.xmlResult) { var rows = data.split(\n); for (var i=0; i rows.length; i++) { var row = $.trim(rows[i]); if (row) { row = row.split(|); parsed[parsed.length] = { data: row, value: row[0], result: options.formatResult options.formatResult(row, row[0]) || row[0] }; } } } else { var count = 0; $(data).find(options.xmlResult).each(function() { var aux = []; aux[0] = $(this).html(); for(i=0;ioptions.xmlAttrNodes.length;i++) { aux[i+1] = $(this).attr(options.xmlAttrNodes[i]); } parsed[count++] = { data: aux, value: aux[0], result: options.formatResult options.formatResult(aux, aux[0]) || aux[0] }; }); } return parsed; }; and did this inside the $.Autocompleter.defaults declaration xmlResult: false, xmlAttrNodes: [id, value], So, Is this code OK to be incorporated to future releases of the Autocomplete plugin? Thanks in advanced. 2009/9/10 alexbodn.gro...@gmail.com play with the options to autocomplete: dataType, parse are handling the conversation with the server. On Wed, Sep 9, 2009 at 16:11, Joao Gilberto joaogilbertomagalh...@gmail.com wrote: Hi, First of all, I want to thank you about your excellent Autocomplete plugin for jQuery. So, I plan use your component in my open source framework called XMLNuke. This framework produces XML, so I made some changes in jQuery Autocomplement plugin to support receive XML data. Here an Example: $(#teste3).autocomplete(demo/search.php, { width: 260, selectFirst: false, xmlResult: value, xmlAttrNodes: [ id, info ] }); The XML looks like to: rootnode value id=1 info=Some Info 1Some Description 1/value value id=2 info=Some Info 2Some Description 2/value value id=3 info=Some Info 3Some Description 3/value /rootnode How do I attach the file with the changes in Plugin? -- alex -- alex -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: JQuery Autocomplete Values/Presetting
On Fri, Sep 11, 2009 at 22:44, Erick erickwo...@gmail.com wrote: Hi Alex, Thank you very much for the response, but I'm pretty new to this. Done a LOT of vanilla js, but not much jquery. Could you please help me with the results trigger? I'm assuming in doc.ready, do something like this: $(#my_field).result (function(event, data, formatted) { // do something here? but this isn't on-load, really. }); you have to call it specifically in the code. please node, the second parameter is value, not formatted. that's an error in the example. in the function, you may set value to any field you like, so it will be part of the form as well. Thanks again, Erick On Sep 10, 8:37 pm, alexbodn.gro...@gmail.com wrote: preset Two as value for autocomplete field, and the 2 for the code field. then add a results trigger to set the value param received to the code field. On Thu, Sep 10, 2009 at 19:42, Erick erickwo...@gmail.com wrote: I'm using the JQuery Autocomplete plug-in and having a great deal of difficulty setting the value of the field either in advance (before making it an autocomplete) or after page load. To start, I have a standard text box and was just echoing a value from php into the value= param. Then, on page load, I set the input to autocomplete. That would wipe out the value I had entered. Next I tried setting it after setting the input as an autocomplete. That looked like it worked, but it really doesn't sync to the values in the search list. For more info, I am using a value/id array as the search values. For those unfamiliar, the array is structured like: [ ['One',1], ['Two',2], ['Three',3] ] The autocomplete functionality works great and result gives me the ID, I just cannot seem to figure out how to preset the value to 2 and display 'Two', for example. Any help greatly appreciated! Erick -- alex smime.p7s 1KViewDownload -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: [autocomplete] a few improvements to autocomplete
On Wed, Sep 9, 2009 at 18:31, alexbodn.gro...@gmail.com wrote: hello friends, i have done a few improvements to the autocomplete module, to fix problems and improve functionality: added selectOnly option to autoselect a result if there's only one. this may save you a click. moved the loading indicator to the left side, in case the field is rtl. requires a small plugin i made, attached here. a css entry is being added to this effect. the included css file has this, but as oposed to the main autocomplete.css, colors are given as names. it's nice, but i'm open to changes ;) . added substrings, and substringsSeparators. as oposed to multiple, which deals with a list of elements separated by a fixed string, substringSeparators is a string made of chars, that each and any of them provide a separator between autocompletable strings. it supports editing a program with a closed list of keywords, and operators and spaces as separators. added extraFields, a list of names or ids (if prefixed with #) of other fields to provide as fieldname=value params to the ajax query. in case names are provided, they are expected to be inputs in the same form as the input itself. more complex relationship may be found by adding suitable callbacks to extraParams, which i'd only ask to receive the $input and the key name as parameters. pasted joern's solution to the ticket http://ui.jquery.com/bugs/ticket/3587, to allow pressing of other key combinations while an autocompletable fields has focus, and still keep autocompletion valid. though i can't yet be very specific, i found multiple autocompletion buggy, and hope to devote some time to contribute to it's fix too. it seems that hideresultsnow() is being called much too many times, however in mustmatch failure case it is changing the text. this function has to be split, probably. -- alex -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: Form got submitted when I hit enter on select the value in autocomplete box
this is being treated in the current 1.1 version from bassist On Sat, Aug 29, 2009 at 23:42, pankaj sharma pankaj1...@gmail.com wrote: Any help on this? On Mon, Aug 24, 2009 at 11:14 PM, pankaj sharmapankaj1...@gmail.com wrote: Hi All, In my application,there are several autocomplte field is available. When I type pank and then it list out the several matching in the autocomplete field and select one and then hit the enter then it submitted the entire form, which will cause the error message. Because there are several more mandatory field are there, which i need to fill up. I was trying to restrict in this way, but i believe this is the wrong way. The following will disable enter-to-submit for the entire form. $(#myForm).bind(keypress, function(event) { if(event.keyCode == 13) { return false; } }); Please help me how to resolve this issue in Jquery autocomplete plugin, so that the should not sumbit on hitting enter in autocomplete text box. I am new to this forum, please let me know if you need any more info on this? Thanks -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: [Autocomplete] Receiving data in XML
play with the options to autocomplete: dataType, parse are handling the conversation with the server. On Wed, Sep 9, 2009 at 16:11, Joao Gilberto joaogilbertomagalh...@gmail.com wrote: Hi, First of all, I want to thank you about your excellent Autocomplete plugin for jQuery. So, I plan use your component in my open source framework called XMLNuke. This framework produces XML, so I made some changes in jQuery Autocomplement plugin to support receive XML data. Here an Example: $(#teste3).autocomplete(demo/search.php, { width: 260, selectFirst: false, xmlResult: value, xmlAttrNodes: [ id, info ] }); The XML looks like to: rootnode value id=1 info=Some Info 1Some Description 1/value value id=2 info=Some Info 2Some Description 2/value value id=3 info=Some Info 3Some Description 3/value /rootnode How do I attach the file with the changes in Plugin? -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: [Autocomplete] Detect when autocomplete list is visible
look at version 1.1 from bassist On Tue, Sep 8, 2009 at 10:18, CharlesW cwilt...@gmail.com wrote: Hello, I'm detecting Enter/Return keyup requests, what's a good way to ignore them when the autocomplete list is visible? I tried using $('.ac_results').css('display'), but that doesn't work reliably (it's always none in the keyup handler). Any ideas appreciated! -- Charles -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: [Autocomplete] Autofill Comma Seperator Issues
please try the demo at http://jquery.bassistance.de/autocomplete/demo/, on the field Multiple Cities (local), the name Oregon. On Tue, Sep 1, 2009 at 11:49, Mil formboardem...@wdoenterprises.com wrote: Hi, I am trying to use this autocomplete http://docs.jquery.com/Plugins/Autocomplete but I'm having some issues with it. I'm trying to create a simple tag autocomplete feature. This is what I want to type (Example 1) TextArea: Cake, Ca, Caldren, Calimari, This is what I get (Example 2) TextArea: Cake, Cake, Caldren, Calimari, In Javascript, my var data = [Cake, Caldren, Calimari]; As you can see, I cannot type Ca because the information will autofill to Cake every time I type a comma. The only way I can avoid this is to do something very un-user friendly. That is to type Ca then press space and then type my comma. That's the only way I can do it to make Example 1 work. This is my code: jQuery(#TagBox).autocomplete(data, { multiple: true, highlight: false, multipleSeparator: , }); What am I doing wrong? -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: autocomplete
i'm not sure i'd make it part of the widget, since it doesn't treat the options linearly. you may create any element with an onclick event to get the same values autocomplete would and display them similar to autocomplete list too. On Mon, Aug 17, 2009 at 00:06, ser999 ser...@gmail.com wrote: I am new to using jQuery and the autocomplete widget (which is great). I would like to add a button with an event to show ALL availbale options. Kind of like regular dropdown element. Is there a way to do this? Thanks Sergey -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: [autocomplete] Missing space character in request
think of a patch with an option with this effect. On Sat, Aug 8, 2009 at 17:00, aw wasielew...@gmx.de wrote: Hi, Using the autocomplete plugin works fine. But submitted values are trimmed. Is it possible to send data with ending space characters like the escape function in JavaScript? Thanks. -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: autocomplete.js plugin
well, it returned a list. multiple is for editing a list of autocomplete values, separated by ',' by default. i think you don't need multiple. but since the list is separated by '|', you need to supply a custom parse function. the default separates values by new lines, while '|' separes between value and code on the same row. On Thu, Sep 10, 2009 at 20:42, DTaylor dgt...@gmail.com wrote: I've got an autocomplete back end that returns multiple results, separated by pipes: http://38.119.36.106/jquery/headerSearch.aspx?q=queens Then on the top of this page I have a search field that uses the autocomplete plugin. http://38.119.36.106/ Try typing in queens into the box. It only shows 1 result! Even though the back end returns multiple records for that result. Here's my jQuery code. As you can see, I've told it to suport multiple entries and set a max at 20. var ac = $(.headerSearch).autocomplete(/jquery/HeaderSearch.aspx, { multiple: true, width: 300, minChars: 4, lineSeparator: '|', max: 20, mustMatch: false, scrollHeight: 220 }); Any idea why it's only showing one record in the autocomplete dropdown??? -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: JQuery Autocomplete Values/Presetting
preset Two as value for autocomplete field, and the 2 for the code field. then add a results trigger to set the value param received to the code field. On Thu, Sep 10, 2009 at 19:42, Erick erickwo...@gmail.com wrote: I'm using the JQuery Autocomplete plug-in and having a great deal of difficulty setting the value of the field either in advance (before making it an autocomplete) or after page load. To start, I have a standard text box and was just echoing a value from php into the value= param. Then, on page load, I set the input to autocomplete. That would wipe out the value I had entered. Next I tried setting it after setting the input as an autocomplete. That looked like it worked, but it really doesn't sync to the values in the search list. For more info, I am using a value/id array as the search values. For those unfamiliar, the array is structured like: [ ['One',1], ['Two',2], ['Three',3] ] The autocomplete functionality works great and result gives me the ID, I just cannot seem to figure out how to preset the value to 2 and display 'Two', for example. Any help greatly appreciated! Erick -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] [autocomplete] a few improvements to autocomplete
hello friends, i have done a few improvements to the autocomplete module, to fix problems and improve functionality: added selectOnly option to autoselect a result if there's only one. this may save you a click. moved the loading indicator to the left side, in case the field is rtl. requires a small plugin i made, attached here. a css entry is being added to this effect. the included css file has this, but as oposed to the main autocomplete.css, colors are given as names. it's nice, but i'm open to changes ;) . added substrings, and substringsSeparators. as oposed to multiple, which deals with a list of elements separated by a fixed string, substringSeparators is a string made of chars, that each and any of them provide a separator between autocompletable strings. it supports editing a program with a closed list of keywords, and operators and spaces as separators. added extraFields, a list of names or ids (if prefixed with #) of other fields to provide as fieldname=value params to the ajax query. in case names are provided, they are expected to be inputs in the same form as the input itself. more complex relationship may be found by adding suitable callbacks to extraParams, which i'd only ask to receive the $input and the key name as parameters. pasted joern's solution to the ticket http://ui.jquery.com/bugs/ticket/3587, to allow pressing of other key combinations while an autocompletable fields has focus, and still keep autocompletion valid. though i can't yet be very specific, i found multiple autocompletion buggy, and hope to devote some time to contribute to it's fix too. -- alex jquery.autocomplete.js Description: JavaScript source jquery.direction.js Description: JavaScript source .ac_results { padding: 0px; border: 1px solid black; background-color: Window; overflow: hidden; z-index: 9; } .ac_results ul { width: 100%; list-style-position: outside; list-style: none; padding: 0; margin: 0; } .ac_results li { margin: 0px; padding: 2px 5px; cursor: default; display: block; /* if width will be 100% horizontal scrollbar will apear when scroll mode will be used */ /*width: 100%;*/ font: menu; font-size: 12px; /* it is very important, if line-height not setted or setted in relative units scroll will be broken in firefox */ line-height: 16px; overflow: hidden; } .ac_loading { background : Window url('indicator.gif') right center no-repeat; } .ac_loading_rtl { background : Window url('indicator.gif') left center no-repeat; } .ac_odd { background-color: #eee; } .ac_over { background-color: #0A246A; color: HighlightText; } smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: [autocomplete] key - value
hello, you should make an additional input for the code, and set a result trigger to update the code. as for the data you supply, it should be in the format 'description1|key1\ndesc...'. search google for good examples. On Wed, Sep 9, 2009 at 17:43, TiGeRWooDtigwod.e...@gmail.com wrote: Hi, Is there a way to use $key = $value 45 = 'some text' And search in $value (some text) but when I select 'some text', it's the $key (45) as input value instead 'some text' ? Thanks in advance. ps : sorry for my poor english. -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: Autocomplete: implement result() to link a selection
google for the result trigger of autocomplete, and perform an href.location=x there. On Thu, Sep 10, 2009 at 02:02, ripcurlksmkevin.mccorm...@cox.net wrote: Can anyone offer any suggestion to allow for me to get this to work? If I type something like Green and click on the suggestion, I want it to go to a page like page.php?id=1. If I type something like Red and click on the suggestion, I want it to go to a page like page.php?id=2. %-| -- View this message in context: http://www.nabble.com/Autocomplete%3A-implement-result%28%29-to-link-a-selection-tp25283153s27240p25374595.html Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: [autocomplete] Enable creation of new list entries?
autocomplete is the place to enter some text based on a list of values. you may set mustMatch:false, and you'll be able to enter text not in the list. then, if you set on* on the input field, it may do whatever you want with the text you entered. On Wed, Sep 9, 2009 at 20:41, starkosstar...@gmail.com wrote: I would like to add a Create new... item to my autocomplete lists to give users a way to create new items. This item would stick at either the top of the bottom of the suggestion list and, when selected, fire a callback where I could display a dialog to collect the information for the new entry, which would then go into the autocomplete list. I could easily be missing something but this doesn't look possible out of the box. Has anyone done something like this before? More explanation: I'm selecting from a list of people. If the person I'm looking for isn't in the list I need to pop up a dialog so I can enter their name, email, etc. That new person then gets put into the autocomplete list and selected into the form field. I've been poking around the source code but haven't been able to figure out a way to implement this yet. Any suggestions or alternate approaches would be most welcome. Thanks! -st. -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: autocomplete accents
maybe the matching could be done in a callback function? On Mon, Sep 7, 2009 at 12:15, sebastien cremesebastien.cr...@gmail.com wrote: Hello, i'm trying to use automplete plugin and deal with accents in data and in search. The main problem is how to display 'déb...' or 'dèb...' when user inputs 'deb'. I have started to modify autocomplete code in order to make this happen. The main parts are in matchSubset and highlight method. Do you think that an option like matchAccents could be a valuated addition to autocomplete ? cheers sebastien -- alex smime.p7s Description: S/MIME Cryptographic Signature
[jQuery] Re: a probable bug with keyboard events
hello joern, sorry didn't see your answer. your patch proposed to the ticket is working great. please commit it if you can. On Fri, Nov 14, 2008 at 16:44, Jörn Zaeffererjoern.zaeffe...@googlemail.com wrote: Finally a ticket: http://ui.jquery.com/bugs/ticket/3587 Jörn On Mon, Oct 20, 2008 at 2:59 AM, alex bodnaru alexbodn.gro...@gmail.com wrote: backspace support added. alex On Mon, Oct 20, 2008 at 02:08, alex bodnaru alexbodn.gro...@gmail.com wrote: don't tell me i forgot to attach the file ;) On Sun, Oct 19, 2008 at 18:15, alex bodnaru alexbodn.gro...@gmail.com wrote: hello dan, everybody. i have posted yesterday on this list a few improvements to autocomplete for your review, which i'd be glad to see committed if ok. as it turned out, the work was more delicate, but with your expert guidance i got the hoped result. here is jquery.autocomplete.js, as patched to ignore noisy key presses and to additionally append fields values to the ajax query. last but not least, i have given the input widget focus after selection from the list, since this widget is made for people who wish to use the keyboard. additionally, maybe a configuration option will allow automatic move to the next field, to save even more fuss from the user. please take a look an freely use my work. best regards, alex On Sun, Oct 19, 2008 at 17:40, alex bodnaru alexbodn.gro...@gmail.com wrote: hi dan, thanks for your answer. i'm logging the keydown event on the input in the plugin autocomplete. the keydown is there to react to movement, return and delete, and in the default condition it may check for eventual changes in the input field. but, pressing of a hebrew character immediately after the keymap switching with alt-shift (which is itself captured by keydown as alt) is not getting in keydown at all, however it changed the field value. anyway, the keyCode of hebrew chars in keydown is always 0. i will try to move handling of non movement keypresses in keypress, and soon report. best regards, alex On Sun, Oct 19, 2008 at 15:47, Dan Switzer dswit...@pengoworks.com wrote: Alex, What keyboard event are you logging? Some events are only captured by a keypress event and will be ignored by the keydown event. -Dan On Sun, Oct 19, 2008 at 5:12 AM, alex bodnaru alexbodn.gro...@gmail.com wrote: hello friends, i ran into a corner case with jquery autocomplete which i'd like to seek a solution for: my system is bilingual (en-he) gnome debian linux, with firefox 3.0.3. with focus on an autocomplete field, i'm switching the keymap to hebrew, using alt-shift. logging the event keyCode to the firebug console, i get one 18 value, followed sometimes by a 0 additional event. the next character i'm typing into the field is being shown, but does not trigger a keycode event, hence the autocompletion doesn't react. this doesn't happen when i switch the language to english, probably because ascii characters have non-zero keyCodes. but the following character i'm typing acts ok. no, this is not because minChars. i assume that the alt-shift is leaving the event manager in an ambiguous state, which invalidates an unicode char, but is being later cleaned by typing another char, or bksp/del. could you help? best regards, alex -- alex smime.p7s Description: S/MIME Cryptographic Signature