[jQuery] Re: Autocomplete plugin compatability with jQuery 1.4?

2010-02-01 Thread Anthony
Hi,

Thanks for your responses. Can I ask 1 follow up question...

Bearing in mind this has now been integrated into jQuery UI 1.8rc1, is
it safe to assume that there any no plans to make the old version 1.1
of the 'Autocomplete' plugin compatible with jQuery 1.4?  The reason I
ask is that it looks like there are a fair number of missing options
from the new integrated version (the most important for us our the
'multiple' related options and the searching options (eg 'matchCase'
and 'matchContains')). Or is the intention to add these or similar to
the new integrated jQuery UI version?

Just be interested to know, as we are already making good use of some
of the above options in our product, want to upgrade to jQuery 1.4 and
jQuery 1.8 as soon as we can, but have hit this hurdle.

Regards,
Anthony.




On Jan 31, 9:31 pm, Richard D. Worth rdwo...@gmail.com wrote:
 Yes, and yes.

 On Sun, Jan 31, 2010 at 3:41 PM, Jose jmal...@gmail.com wrote:
  On Fri, Jan 29, 2010 at 1:38 AM, Richard D. Worth rdwo...@gmail.com
  wrote:
   The latest version is jQuery UI Autocomplete, and it is compatible with
   jQuery 1.4. You can find it in jQuery UI 1.8rc1:

  http://blog.jqueryui.com/2010/01/jquery-ui-1-8rc1/

  Is the UI autocomplete based on Jörn's autocomplete ? If seems a huge
  refactoring!

  regards


Re: [jQuery] Re: Autocomplete plugin compatability with jQuery 1.4?

2010-02-01 Thread Jörn Zaefferer
I've replied on that here:
http://forum.jquery.com/topic/1-8rc1-autocomplete-search-options

So far I don't plan to update the standalone plugin, though if you can
provide a patch for 1.4 compability, I'd push out another release.

Jörn

On Mon, Feb 1, 2010 at 3:32 PM, Anthony antray...@gmail.com wrote:
 Hi,

 Thanks for your responses. Can I ask 1 follow up question...

 Bearing in mind this has now been integrated into jQuery UI 1.8rc1, is
 it safe to assume that there any no plans to make the old version 1.1
 of the 'Autocomplete' plugin compatible with jQuery 1.4?  The reason I
 ask is that it looks like there are a fair number of missing options
 from the new integrated version (the most important for us our the
 'multiple' related options and the searching options (eg 'matchCase'
 and 'matchContains')). Or is the intention to add these or similar to
 the new integrated jQuery UI version?

 Just be interested to know, as we are already making good use of some
 of the above options in our product, want to upgrade to jQuery 1.4 and
 jQuery 1.8 as soon as we can, but have hit this hurdle.

 Regards,
 Anthony.




 On Jan 31, 9:31 pm, Richard D. Worth rdwo...@gmail.com wrote:
 Yes, and yes.

 On Sun, Jan 31, 2010 at 3:41 PM, Jose jmal...@gmail.com wrote:
  On Fri, Jan 29, 2010 at 1:38 AM, Richard D. Worth rdwo...@gmail.com
  wrote:
   The latest version is jQuery UI Autocomplete, and it is compatible with
   jQuery 1.4. You can find it in jQuery UI 1.8rc1:

  http://blog.jqueryui.com/2010/01/jquery-ui-1-8rc1/

  Is the UI autocomplete based on Jörn's autocomplete ? If seems a huge
  refactoring!

  regards



Re: [jQuery] Re: Autocomplete plugin compatability with jQuery 1.4?

2010-01-31 Thread Jose
On Fri, Jan 29, 2010 at 1:38 AM, Richard D. Worth rdwo...@gmail.com wrote:
 The latest version is jQuery UI Autocomplete, and it is compatible with
 jQuery 1.4. You can find it in jQuery UI 1.8rc1:

 http://blog.jqueryui.com/2010/01/jquery-ui-1-8rc1/

Is the UI autocomplete based on Jörn's autocomplete ? If seems a huge
refactoring!

regards


Re: [jQuery] Re: Autocomplete plugin compatability with jQuery 1.4?

2010-01-31 Thread Richard D. Worth
Yes, and yes.

On Sun, Jan 31, 2010 at 3:41 PM, Jose jmal...@gmail.com wrote:

 On Fri, Jan 29, 2010 at 1:38 AM, Richard D. Worth rdwo...@gmail.com
 wrote:
  The latest version is jQuery UI Autocomplete, and it is compatible with
  jQuery 1.4. You can find it in jQuery UI 1.8rc1:
 
  http://blog.jqueryui.com/2010/01/jquery-ui-1-8rc1/

 Is the UI autocomplete based on Jörn's autocomplete ? If seems a huge
 refactoring!

 regards



[jQuery] Re: Autocomplete plugin compatability with jQuery 1.4?

2010-01-28 Thread dirk.diggler
Anthony,

The short answer would appear to be no, it's not compatible.  To be
fair, I'm running a slightly tweaked version of the plugin, so its
entirely possible the incompatibility is something I introduced. This
seems unlikely, though, since Firebug never even hits the breakpoint
I've set in the autocomplete entry point function.


On Jan 19, 8:24 am, Anthony Rayner antray...@gmail.com wrote:
  Hi all,

 We're using Jörn Zaefferer's awesome
 'Autocompletehttp://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/'
 plugin and wondered if anyone knows if it is compatible with jQuery 1.4? Be
 very intereseted to find out.

 Many thanks.
 Anthony.


Re: [jQuery] Re: Autocomplete plugin compatability with jQuery 1.4?

2010-01-28 Thread Richard D. Worth
The latest version is jQuery UI Autocomplete, and it is compatible with
jQuery 1.4. You can find it in jQuery UI 1.8rc1:

http://blog.jqueryui.com/2010/01/jquery-ui-1-8rc1/

- Richard

On Thu, Jan 28, 2010 at 6:44 PM, dirk.diggler mitch.ab...@gmail.com wrote:

 Anthony,

 The short answer would appear to be no, it's not compatible.  To be
 fair, I'm running a slightly tweaked version of the plugin, so its
 entirely possible the incompatibility is something I introduced. This
 seems unlikely, though, since Firebug never even hits the breakpoint
 I've set in the autocomplete entry point function.


 On Jan 19, 8:24 am, Anthony Rayner antray...@gmail.com wrote:
   Hi all,
 
  We're using Jörn Zaefferer's awesome
  'Autocomplete
 http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/'
  plugin and wondered if anyone knows if it is compatible with jQuery 1.4?
 Be
  very intereseted to find out.
 
  Many thanks.
  Anthony.



[jQuery] Re: autocomplete returning multiple identical values in dropdown

2010-01-17 Thread MorningZ
You pulling the data from server side code?  if so, it's that codes
responsibility to return unique values


On Jan 17, 4:25 pm, rumremix sdiv...@gmail.com wrote:
 The autocomplete plugin I obtained 
 fromhttp://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/is
 working great aside from one significant problem: it is returning
 multiple identical results in the dropdown.

 Say I wish to search for all records that contain 'march' in the month
 field and there are 12 such records that meet this criteria. I don't
 want a dropdown to appear that dispays 'march' 12 times if I type 'm'
 in the month field. I want only two values to appear exactly once
 each: 'march', and 'may'.

 It appears as though the code was written with the expectation that
 the data will contain all unique values. Or am I doing something
 wrong? I have been unable to see any option settings that control
 this.

 Thanks.


[jQuery] Re: Autocomplete incompatible with certain struts-tiles-javascript apps

2010-01-15 Thread j...@verax
I found the problem.

Its the $ sign !  The $ sign has a very special meaning in the jQuery
framework. So if it is used in any other Javascript that doesnt use
jQuery, it will be incompatible. So this means we should not use '$'
in our code just because it looks cool ! Also, be very careful when
you copy javascript plug-ins from the internet if you are already
using javascript frameworks. They will most likely create an
incompatibility.

I have to now do either of the following:

a) re-write all my javascript code to use jQuery
b) write my own autocomplete javascript.

On Jan 14, 5:24 pm, j...@verax joti.bis...@gmail.com wrote:
 Hi jQuery guru,

 I have an application based on struts and tiles. Validation is done by
 javascript at a global level.
 When I include my autocomplete code in my JSP page, the validation
 (checkValidation()) malfunctions with a javascript error  - Object
 does not support this property or method at the line

  if (CCRDerrorContainer.hasChildNodes()).

 If I remove the autocomplete code from my JSP (business logic +
 autocomplete libraries) , the validation works as designed. Details of
 relevant code is provided below. Can anyone provide me with any clue
 as to how to resolve this problem ?

 ==

 ---­
 My JSP file
 ---­
 %@ include file=../common/include.jsp %
 link rel=stylesheet type=text/css   href=css/
 jquery.autocomplete.css /
 script type=text/javascript src=js/autocomplete/lib/jquery.js/
 script
 script type='text/javascript' src='js/autocomplete/
 jquery.autocomplete.js'/script

 script
                         var cols = []; // column mappings : 0=Last name, 
 1=First Name,
 2=Title, 3 = Employee ID
                         $().ready(function() {

                                 $('input#employeeLastName').flushCache();
                                 
 $(#employeeLastName).autocomplete(jsp/common/getData.jsp?
 dataType=EmployeeName,{
                                         minChars: 1,
                                         max: 1000,
                                         width: 400,
                                         delay: 1000,
                                         selectFirst: false,
                                         autoFill: false,
                                         cacheLength: 20,
                                         matchContains: false,
                                         matchSubset: true,
                                         mustMatch: false,
                                         matchCase: true,
                                         formatItem: function(row, i, max) {
                                                 cols = row[0].split(%);
                                                 return i + / + max + :  + 
 cols[0] + ,  + cols[1] +  ( +
 cols[2] + );
                                         },
                                         formatMatch: function(row) {
                                                 cols = row[0].split(%);
                                                 return cols[0] + ,  + 
 cols[1];
                                         },
                                         formatResult: function(row) {
                                                 cols = row[0].split(%);
                                                 return cols[0] + ,  + 
 cols[1] +  ( + cols[2] + );
                                         }
                                 });
                                 $(#employeeLastName).result(function(event, 
 row, formatted) {
                                         if (row) {
                                                 cols = row[0].split(%);
                                                 $(this).next().val(cols[3]);
                                         }
                                 });
                         });
 /script
 tiles:importAttribute name=task /
 tiles:importAttribute name=action /
 tiles:importAttribute name=displayAction /
 tiles:importAttribute name=showArchived /

 style type=text/css
         @import ${pageContext.request.contextPath}/css/employee/select.css;
 /style

 h1
         fmt:message key=employee.label.title.select /
 /h1
 hr /

 div id=employeeSelect
         tiles:insert definition=successMessages /
         tiles:insert definition=failureMessages /
         ccrd:errors /

         html:form action=${action} method=post 

                 label for=employee id=employeeLbl 
                         fmt:message key=employee.text.selectEmployee /
                         span class=taskfmt:message key=${task} 
 /:/span
                 /label

                 html:text styleId=employeeLastName property=lastName
 size=100
                         maxlength=200
                 /html:text
 

Re: [jQuery] Re: Autocomplete incompatible with certain struts-tiles-javascript apps

2010-01-15 Thread Jon Banner
have a go with http://docs.jquery.com/Core/jQuery.noConflict

2010/1/15 j...@verax joti.bis...@gmail.com

 I found the problem.

 Its the $ sign !  The $ sign has a very special meaning in the jQuery
 framework. So if it is used in any other Javascript that doesnt use
 jQuery, it will be incompatible. So this means we should not use '$'
 in our code just because it looks cool ! Also, be very careful when
 you copy javascript plug-ins from the internet if you are already
 using javascript frameworks. They will most likely create an
 incompatibility.

 I have to now do either of the following:

 a) re-write all my javascript code to use jQuery
 b) write my own autocomplete javascript.

 On Jan 14, 5:24 pm, j...@verax joti.bis...@gmail.com wrote:
  Hi jQuery guru,
 
  I have an application based on struts and tiles. Validation is done by
  javascript at a global level.
  When I include my autocomplete code in my JSP page, the validation
  (checkValidation()) malfunctions with a javascript error  - Object
  does not support this property or method at the line
 
   if (CCRDerrorContainer.hasChildNodes()).
 
  If I remove the autocomplete code from my JSP (business logic +
  autocomplete libraries) , the validation works as designed. Details of
  relevant code is provided below. Can anyone provide me with any clue
  as to how to resolve this problem ?
 
  ==
 
 
 ---­
  My JSP file
 
 ---­
  %@ include file=../common/include.jsp %
  link rel=stylesheet type=text/css   href=css/
  jquery.autocomplete.css /
  script type=text/javascript src=js/autocomplete/lib/jquery.js/
  script
  script type='text/javascript' src='js/autocomplete/
  jquery.autocomplete.js'/script
 
  script
  var cols = []; // column mappings : 0=Last name,
 1=First Name,
  2=Title, 3 = Employee ID
  $().ready(function() {
 
  $('input#employeeLastName').flushCache();
 
 $(#employeeLastName).autocomplete(jsp/common/getData.jsp?
  dataType=EmployeeName,{
  minChars: 1,
  max: 1000,
  width: 400,
  delay: 1000,
  selectFirst: false,
  autoFill: false,
  cacheLength: 20,
  matchContains: false,
  matchSubset: true,
  mustMatch: false,
  matchCase: true,
  formatItem: function(row, i, max)
 {
  cols = row[0].split(%);
  return i + / + max + :
  + cols[0] + ,  + cols[1] +  ( +
  cols[2] + );
  },
  formatMatch: function(row) {
  cols = row[0].split(%);
  return cols[0] + ,  +
 cols[1];
  },
  formatResult: function(row) {
  cols = row[0].split(%);
  return cols[0] + ,  +
 cols[1] +  ( + cols[2] + );
  }
  });
 
 $(#employeeLastName).result(function(event, row, formatted) {
  if (row) {
  cols = row[0].split(%);
 
 $(this).next().val(cols[3]);
  }
  });
  });
  /script
  tiles:importAttribute name=task /
  tiles:importAttribute name=action /
  tiles:importAttribute name=displayAction /
  tiles:importAttribute name=showArchived /
 
  style type=text/css
  @import
 ${pageContext.request.contextPath}/css/employee/select.css;
  /style
 
  h1
  fmt:message key=employee.label.title.select /
  /h1
  hr /
 
  div id=employeeSelect
  tiles:insert definition=successMessages /
  tiles:insert definition=failureMessages /
  ccrd:errors /
 
  html:form action=${action} method=post 
 
  label for=employee id=employeeLbl 
  fmt:message key=employee.text.selectEmployee
 /
  span class=taskfmt:message key=${task}
 /:/span
  /label
 
  html:text 

[jQuery] Re: Autocomplete incompatible with certain struts-tiles-javascript apps

2010-01-15 Thread j...@verax
Thanks, Jon,

I tried out the technique described in the link that you provided and
it worked very well.

Thank you for saving much of my time and effort.

On Jan 15, 11:19 am, Jon Banner banali...@googlemail.com wrote:
 have a go withhttp://docs.jquery.com/Core/jQuery.noConflict

 2010/1/15 j...@verax joti.bis...@gmail.com



  I found the problem.

  Its the $ sign !  The $ sign has a very special meaning in the jQuery
  framework. So if it is used in any other Javascript that doesnt use
  jQuery, it will be incompatible. So this means we should not use '$'
  in our code just because it looks cool ! Also, be very careful when
  you copy javascript plug-ins from the internet if you are already
  using javascript frameworks. They will most likely create an
  incompatibility.

  I have to now do either of the following:

  a) re-write all my javascript code to use jQuery
  b) write my own autocomplete javascript.

  On Jan 14, 5:24 pm, j...@verax joti.bis...@gmail.com wrote:
   Hi jQuery guru,

   I have an application based on struts and tiles. Validation is done by
   javascript at a global level.
   When I include my autocomplete code in my JSP page, the validation
   (checkValidation()) malfunctions with a javascript error  - Object
   does not support this property or method at the line

    if (CCRDerrorContainer.hasChildNodes()).

   If I remove the autocomplete code from my JSP (business logic +
   autocomplete libraries) , the validation works as designed. Details of
   relevant code is provided below. Can anyone provide me with any clue
   as to how to resolve this problem ?

   ==

  ---­­
   My JSP file

  ---­­
   %@ include file=../common/include.jsp %
   link rel=stylesheet type=text/css   href=css/
   jquery.autocomplete.css /
   script type=text/javascript src=js/autocomplete/lib/jquery.js/
   script
   script type='text/javascript' src='js/autocomplete/
   jquery.autocomplete.js'/script

   script
                           var cols = []; // column mappings : 0=Last name,
  1=First Name,
   2=Title, 3 = Employee ID
                           $().ready(function() {

                                   $('input#employeeLastName').flushCache();

  $(#employeeLastName).autocomplete(jsp/common/getData.jsp?
   dataType=EmployeeName,{
                                           minChars: 1,
                                           max: 1000,
                                           width: 400,
                                           delay: 1000,
                                           selectFirst: false,
                                           autoFill: false,
                                           cacheLength: 20,
                                           matchContains: false,
                                           matchSubset: true,
                                           mustMatch: false,
                                           matchCase: true,
                                           formatItem: function(row, i, max)
  {
                                                   cols = row[0].split(%);
                                                   return i + / + max + :
   + cols[0] + ,  + cols[1] +  ( +
   cols[2] + );
                                           },
                                           formatMatch: function(row) {
                                                   cols = row[0].split(%);
                                                   return cols[0] + ,  +
  cols[1];
                                           },
                                           formatResult: function(row) {
                                                   cols = row[0].split(%);
                                                   return cols[0] + ,  +
  cols[1] +  ( + cols[2] + );
                                           }
                                   });

  $(#employeeLastName).result(function(event, row, formatted) {
                                           if (row) {
                                                   cols = row[0].split(%);

  $(this).next().val(cols[3]);
                                           }
                                   });
                           });
   /script
   tiles:importAttribute name=task /
   tiles:importAttribute name=action /
   tiles:importAttribute name=displayAction /
   tiles:importAttribute name=showArchived /

   style type=text/css
           @import
  ${pageContext.request.contextPath}/css/employee/select.css;
   /style

   h1
           fmt:message key=employee.label.title.select /
   /h1
   hr /

   div id=employeeSelect
           tiles:insert definition=successMessages /
           tiles:insert definition=failureMessages /
           ccrd:errors /

           html:form 

[jQuery] Re: autocomplete: extra fields

2010-01-14 Thread Michael Lang
If you want the extraParams passed to your data url to include other
form input values then you need to define the values as a function.
In that function use jquery to get the values of the other inputs.


$(#addressCity).autocomplete('http://www.example.com/api/
getcities/', {
minChars: 1,
autoFill:false,
extraParams: {
country: function() {
return $('#country').val();
},
region: function() {
return $('#region').val();
}
}
});

In this example the other input box IDs were 'country' and 'region'.
Both which need to filter the list of cities.

On Dec 18 2009, 7:27 pm, Simon Matthews sam.applic...@googlemail.com
wrote:
 I have a number of fields in a grid which are all using auto
 complete.  I want the extraParams function to be able to work out
 which field I am in so that I can return a differently filtered list.
 I don't seem to have access to the input variable?  Any clues?

 Thanks

 Simon


[jQuery] Re: autocomplete: extra fields

2010-01-14 Thread MorningZ
I tried for so long to accomplish what you ask (which i think is tell
the server side autocomplete target what field am i?), only to throw
up my hands in dismissal...

I finally just did it this way:

say i had:

input type=text id=AC_Name class=ac /
input type=text id=AC_Email class=ac /
input type=text id=AC_Title class=ac /

I just wired up the plugin like so:

$(.ac).each(function() {
   $(this).autocomplete(
target.html,
 {
extraParams :
   {
   id: $(this).attr(id)
   }
 }
   );
});

now id=AC_Name or id=AC_Email or id=AC_Title gets sent along in
the querystring to target.html

maybe there's a more elegant way to do it, but i gave up finding
it   :-)




On Dec 18 2009, 8:27 pm, Simon Matthews sam.applic...@googlemail.com
wrote:
 I have a number of fields in a grid which are all using auto
 complete.  I want the extraParams function to be able to work out
 which field I am in so that I can return a differently filtered list.
 I don't seem to have access to the input variable?  Any clues?

 Thanks

 Simon


[jQuery] Re: Autocomplete selection blanks out input field

2010-01-14 Thread j...@verax
Thanks Marty. I implemented your suggestion and it worked.

On Jan 12, 2:40 pm, Marty Jones martybjo...@gmail.com wrote:
 I had the same issue.  The mustMatch flag causes the second request
 to validate the text that was set.  Make sure that the selected input
 value can successfully be submitted to your ajax request and come back
 with a hit.  If a match is not found the the text's input field will
 be cleared.

 On Jan 11, 2:58 pm, j...@verax joti.bis...@gmail.com wrote:



  Hi,

  I have been using the jquery autocomplete plug-in for some time now
  and find it very useful. Lately I have come across the following
  problem in one of my JSP pages.

  The autocomplete suggestions are displayed and formatted properly. But
  when I select the one that I want, the result briefly appears in the
  input field and disappears. Simultaneously, the entered result
  automatically triggers another jquery search.

  The contents of my JSP page is given below. The same jquery code works
  perfectly well with other JSPs. Can anyone help ?

  --JSP
  code---­­-

  %@ include file=../common/include.jsp %
  script
                          var cols = []; // column mappings : 0=Last name, 
  1=First Name,
  2=Title, 3 = Employee ID
                          $().ready(function() {
                                  $('input#employeeLastName').flushCache();
                                  
  $(#employeeLastName).autocomplete(jsp/common/getData.jsp?
  dataType=EmployeeName,{
                                          minChars: 1,
                                          max: 1000,
                                          width: 400,
                                          delay: 1000,
                                          selectFirst: false,
                                          autoFill: false,
                                          cacheLength: 20,
                                          matchContains: false,
                                          matchSubset: true,
                                          mustMatch: true,
                                          matchCase: true,
                                          formatItem: function(row, i, max) {
                                                  cols = row[0].split(%);
                                                  return i + / + max + :  
  + cols[0] + ,  + cols[1] +  ( +
  cols[2] + );
                                          },
                                          formatMatch: function(row) {
                                                  cols = row[0].split(%);
                                                  return cols[0] + ,  + 
  cols[1];
                                          },
                                          formatResult: function(row) {
                                                  cols = row[0].split(%);
                                                  return cols[0] + ,  + 
  cols[1] +  ( + cols[2] + );
                                          }
                                  });
                                  
  $(#employeeLastName).result(function(event, row, formatted) {
                                          if (row) {
                                                  cols = row[0].split(%);
                                                  $(this).next().val(cols[3]);
                                          }
                                  });
                          });
  /script

  tiles:importAttribute name=task /
  tiles:importAttribute name=action /
  tiles:importAttribute name=displayAction /
  tiles:importAttribute name=showArchived /

  style type=text/css
          @import 
  ${pageContext.request.contextPath}/css/employee/select.css;
  /style

  h1
          fmt:message key=employee.label.title.select /
  /h1
  hr /

  div id=employeeSelect
          tiles:insert definition=successMessages /
          tiles:insert definition=failureMessages /
          ccrd:errors /

          html:form action=${action} method=post 

                  label for=employee id=employeeLbl 
                          fmt:message key=employee.text.selectEmployee /
                          span class=taskfmt:message key=${task} 
  /:/span
                  /label

                  html:text styleId=employeeLastName property=lastName
  size=100
                          maxlength=200
                  /html:text
                  html:hidden property=employeeId /
                  BR/ BR/
                  div class=buttons
                          html:submit property=submit 
  styleId=submitButtonfmt:message
  key=button.submit//html:submit
                          html:submit property=cancel 
  styleId=cancelButtonfmt:message
  key=button.cancel//html:submit
                  /div

          /html:form
  /div

  ---end of jsp
  

[jQuery] Re: Autocomplete incompatible with certain struts-tiles-javascript apps

2010-01-14 Thread MorningZ
is that a straight dump of your code?

if so, you don't have script tags around your JavaScript after the
closing /html tag



On Jan 14, 5:24 pm, j...@verax joti.bis...@gmail.com wrote:
 Hi jQuery guru,

 I have an application based on struts and tiles. Validation is done by
 javascript at a global level.
 When I include my autocomplete code in my JSP page, the validation
 (checkValidation()) malfunctions with a javascript error  - Object
 does not support this property or method at the line

  if (CCRDerrorContainer.hasChildNodes()).

 If I remove the autocomplete code from my JSP (business logic +
 autocomplete libraries) , the validation works as designed. Details of
 relevant code is provided below. Can anyone provide me with any clue
 as to how to resolve this problem ?

 ==

 ---
 My JSP file
 ---
 %@ include file=../common/include.jsp %
 link rel=stylesheet type=text/css   href=css/
 jquery.autocomplete.css /
 script type=text/javascript src=js/autocomplete/lib/jquery.js/
 script
 script type='text/javascript' src='js/autocomplete/
 jquery.autocomplete.js'/script

 script
                         var cols = []; // column mappings : 0=Last name, 
 1=First Name,
 2=Title, 3 = Employee ID
                         $().ready(function() {

                                 $('input#employeeLastName').flushCache();
                                 
 $(#employeeLastName).autocomplete(jsp/common/getData.jsp?
 dataType=EmployeeName,{
                                         minChars: 1,
                                         max: 1000,
                                         width: 400,
                                         delay: 1000,
                                         selectFirst: false,
                                         autoFill: false,
                                         cacheLength: 20,
                                         matchContains: false,
                                         matchSubset: true,
                                         mustMatch: false,
                                         matchCase: true,
                                         formatItem: function(row, i, max) {
                                                 cols = row[0].split(%);
                                                 return i + / + max + :  + 
 cols[0] + ,  + cols[1] +  ( +
 cols[2] + );
                                         },
                                         formatMatch: function(row) {
                                                 cols = row[0].split(%);
                                                 return cols[0] + ,  + 
 cols[1];
                                         },
                                         formatResult: function(row) {
                                                 cols = row[0].split(%);
                                                 return cols[0] + ,  + 
 cols[1] +  ( + cols[2] + );
                                         }
                                 });
                                 $(#employeeLastName).result(function(event, 
 row, formatted) {
                                         if (row) {
                                                 cols = row[0].split(%);
                                                 $(this).next().val(cols[3]);
                                         }
                                 });
                         });
 /script
 tiles:importAttribute name=task /
 tiles:importAttribute name=action /
 tiles:importAttribute name=displayAction /
 tiles:importAttribute name=showArchived /

 style type=text/css
         @import ${pageContext.request.contextPath}/css/employee/select.css;
 /style

 h1
         fmt:message key=employee.label.title.select /
 /h1
 hr /

 div id=employeeSelect
         tiles:insert definition=successMessages /
         tiles:insert definition=failureMessages /
         ccrd:errors /

         html:form action=${action} method=post 

                 label for=employee id=employeeLbl 
                         fmt:message key=employee.text.selectEmployee /
                         span class=taskfmt:message key=${task} 
 /:/span
                 /label

                 html:text styleId=employeeLastName property=lastName
 size=100
                         maxlength=200
                 /html:text
                 html:hidden property=employeeId /
                 BR/ BR/
                 div class=buttons
                         html:submit property=submit 
 styleId=submitButtonfmt:message
 key=button.submit//html:submit
                         html:submit property=cancel 
 styleId=cancelButtonfmt:message
 key=button.cancel//html:submit
                 /div

         /html:form
 /div

 

[jQuery] Re: Autocomplete incompatible with certain struts-tiles-javascript apps

2010-01-14 Thread j...@verax
The code as posted (template.jsp) is correctly extracted. Probably
appears that way because of the text wrap. Its working code.

On Jan 14, 6:21 pm, MorningZ morni...@gmail.com wrote:
 is that a straight dump of your code?

 if so, you don't have script tags around your JavaScript after the
 closing /html tag

 On Jan 14, 5:24 pm, j...@verax joti.bis...@gmail.com wrote:



  Hi jQuery guru,

  I have an application based on struts and tiles. Validation is done by
  javascript at a global level.
  When I include my autocomplete code in my JSP page, the validation
  (checkValidation()) malfunctions with a javascript error  - Object
  does not support this property or method at the line

   if (CCRDerrorContainer.hasChildNodes()).

  If I remove the autocomplete code from my JSP (business logic +
  autocomplete libraries) , the validation works as designed. Details of
  relevant code is provided below. Can anyone provide me with any clue
  as to how to resolve this problem ?

  ==

  ---­
  My JSP file
  ---­
  %@ include file=../common/include.jsp %
  link rel=stylesheet type=text/css   href=css/
  jquery.autocomplete.css /
  script type=text/javascript src=js/autocomplete/lib/jquery.js/
  script
  script type='text/javascript' src='js/autocomplete/
  jquery.autocomplete.js'/script

  script
                          var cols = []; // column mappings : 0=Last name, 
  1=First Name,
  2=Title, 3 = Employee ID
                          $().ready(function() {

                                  $('input#employeeLastName').flushCache();
                                  
  $(#employeeLastName).autocomplete(jsp/common/getData.jsp?
  dataType=EmployeeName,{
                                          minChars: 1,
                                          max: 1000,
                                          width: 400,
                                          delay: 1000,
                                          selectFirst: false,
                                          autoFill: false,
                                          cacheLength: 20,
                                          matchContains: false,
                                          matchSubset: true,
                                          mustMatch: false,
                                          matchCase: true,
                                          formatItem: function(row, i, max) {
                                                  cols = row[0].split(%);
                                                  return i + / + max + :  
  + cols[0] + ,  + cols[1] +  ( +
  cols[2] + );
                                          },
                                          formatMatch: function(row) {
                                                  cols = row[0].split(%);
                                                  return cols[0] + ,  + 
  cols[1];
                                          },
                                          formatResult: function(row) {
                                                  cols = row[0].split(%);
                                                  return cols[0] + ,  + 
  cols[1] +  ( + cols[2] + );
                                          }
                                  });
                                  
  $(#employeeLastName).result(function(event, row, formatted) {
                                          if (row) {
                                                  cols = row[0].split(%);
                                                  $(this).next().val(cols[3]);
                                          }
                                  });
                          });
  /script
  tiles:importAttribute name=task /
  tiles:importAttribute name=action /
  tiles:importAttribute name=displayAction /
  tiles:importAttribute name=showArchived /

  style type=text/css
          @import 
  ${pageContext.request.contextPath}/css/employee/select.css;
  /style

  h1
          fmt:message key=employee.label.title.select /
  /h1
  hr /

  div id=employeeSelect
          tiles:insert definition=successMessages /
          tiles:insert definition=failureMessages /
          ccrd:errors /

          html:form action=${action} method=post 

                  label for=employee id=employeeLbl 
                          fmt:message key=employee.text.selectEmployee /
                          span class=taskfmt:message key=${task} 
  /:/span
                  /label

                  html:text styleId=employeeLastName property=lastName
  size=100
                          maxlength=200
                  /html:text
                  html:hidden property=employeeId /
                  BR/ BR/
                  div class=buttons
                          html:submit 

[jQuery] Re: Autocomplete selection blanks out input field

2010-01-12 Thread Marty Jones
I had the same issue.  The mustMatch flag causes the second request
to validate the text that was set.  Make sure that the selected input
value can successfully be submitted to your ajax request and come back
with a hit.  If a match is not found the the text's input field will
be cleared.

On Jan 11, 2:58 pm, j...@verax joti.bis...@gmail.com wrote:
 Hi,

 I have been using the jquery autocomplete plug-in for some time now
 and find it very useful. Lately I have come across the following
 problem in one of my JSP pages.

 The autocomplete suggestions are displayed and formatted properly. But
 when I select the one that I want, the result briefly appears in the
 input field and disappears. Simultaneously, the entered result
 automatically triggers another jquery search.

 The contents of my JSP page is given below. The same jquery code works
 perfectly well with other JSPs. Can anyone help ?

 --JSP
 code---­-

 %@ include file=../common/include.jsp %
 script
                         var cols = []; // column mappings : 0=Last name, 
 1=First Name,
 2=Title, 3 = Employee ID
                         $().ready(function() {
                                 $('input#employeeLastName').flushCache();
                                 
 $(#employeeLastName).autocomplete(jsp/common/getData.jsp?
 dataType=EmployeeName,{
                                         minChars: 1,
                                         max: 1000,
                                         width: 400,
                                         delay: 1000,
                                         selectFirst: false,
                                         autoFill: false,
                                         cacheLength: 20,
                                         matchContains: false,
                                         matchSubset: true,
                                         mustMatch: true,
                                         matchCase: true,
                                         formatItem: function(row, i, max) {
                                                 cols = row[0].split(%);
                                                 return i + / + max + :  + 
 cols[0] + ,  + cols[1] +  ( +
 cols[2] + );
                                         },
                                         formatMatch: function(row) {
                                                 cols = row[0].split(%);
                                                 return cols[0] + ,  + 
 cols[1];
                                         },
                                         formatResult: function(row) {
                                                 cols = row[0].split(%);
                                                 return cols[0] + ,  + 
 cols[1] +  ( + cols[2] + );
                                         }
                                 });
                                 $(#employeeLastName).result(function(event, 
 row, formatted) {
                                         if (row) {
                                                 cols = row[0].split(%);
                                                 $(this).next().val(cols[3]);
                                         }
                                 });
                         });
 /script

 tiles:importAttribute name=task /
 tiles:importAttribute name=action /
 tiles:importAttribute name=displayAction /
 tiles:importAttribute name=showArchived /

 style type=text/css
         @import ${pageContext.request.contextPath}/css/employee/select.css;
 /style

 h1
         fmt:message key=employee.label.title.select /
 /h1
 hr /

 div id=employeeSelect
         tiles:insert definition=successMessages /
         tiles:insert definition=failureMessages /
         ccrd:errors /

         html:form action=${action} method=post 

                 label for=employee id=employeeLbl 
                         fmt:message key=employee.text.selectEmployee /
                         span class=taskfmt:message key=${task} 
 /:/span
                 /label

                 html:text styleId=employeeLastName property=lastName
 size=100
                         maxlength=200
                 /html:text
                 html:hidden property=employeeId /
                 BR/ BR/
                 div class=buttons
                         html:submit property=submit 
 styleId=submitButtonfmt:message
 key=button.submit//html:submit
                         html:submit property=cancel 
 styleId=cancelButtonfmt:message
 key=button.cancel//html:submit
                 /div

         /html:form
 /div

 ---end of jsp
 code---­---


[jQuery] Re: (autocomplete) Half of page disappears in IE7 when autocomplete list shows

2010-01-07 Thread Rune
I have now generated a static copy of the web page containing the
autocomplete dropdown html code (the div in the bottom of the page).
When I load this into IE7 there are no problems. It only fails on the
active page.

On Jan 6, 3:39 pm, Rune a...@rdfined.dk wrote:
 Hi

 I use autocomplete newest version on

 http://www.kle-online.dk/stage

 Things work great in FF and IE8 but in IE7 half of the page disappears
 when the autocomplete list shows. Try to type benz in the search
 field and problem should be easy to see.

 Cheers,
 Rune


Re: [jQuery] Re: (autocomplete) Half of page disappears in IE7 when autocomplete list shows

2010-01-07 Thread Md. Ali Ahsan Rana
Your css probably conflicting with autocomplete plugin's some css/ css class
names..

Check carefully...


-- 
http://ranacseruet.blogspot.com/


[jQuery] Re: (autocomplete) Half of page disappears in IE7 when autocomplete list shows

2010-01-07 Thread Rune
Hi

Thanks a lot - The problem was indeed in a css stylesheet but wasn't
related to any conflicting names. Instead we have a specific IE7-
instruction which looks like this:

body { height: 100%; overflow-y: auto;  }

Autosuggest seems to be incompatible with the overflow-y: auto
property and value. But I'm an amateur in this area so maybe it could
be sorted out in other ways. Right now I have removed this line for
the page with the autosuggest box.

Cheers,
Rune

On Jan 7, 10:17 am, Md. Ali Ahsan Rana ranacser...@gmail.com
wrote:
 Your css probably conflicting with autocomplete plugin's some css/ css class
 names..

 Check carefully...

 --http://ranacseruet.blogspot.com/


[jQuery] Re: autocomplete plugin not working in firefox

2009-12-30 Thread MorningZ
Do you have FireBug installed (you should!) to see if the plugin at
least tries to make the request?

http://www.getfirebug.com

On Dec 30, 8:23 pm, mary ann marya...@gmail.com wrote:
 I'm using the autocomplete plugin.  The following script works in IE,
 but doesn't work in Firefox.  It doesn't appear  that these are even
 being triggered.  So when the page displays in Firefox, the
 searchStudents textbox has no autocomplete associated with it.

 $(document).ready(function() {
     $('#searchStudents').autocomplete('%=Url.Action(Students,
 Student)%', {
             dataType: 'json',
             parse: function(data) {
                 var rows = new Array();
                 for (var i = 0; i  data.length; i++) {
                     rows[i] = { data: data[i], value: data
 [i].LastName, result: data[i].LastName };
                 }
                 return rows;
             },
             formatItem: function(row, i, n) {
                 return row.LastName + ' - ' + row.UserId;
             },
             width: 300,
             mustMatch: false,
             limit: 10
         });

         $('#searchStudents').result(function(event, data, formatted) {
             if (data)
                 $(this).parent().next().find(input).val(data
 [UserId]);
             $('#Students).append('option value=' + data[UserId] +
 '' + data[LastName] + '/option ');
         });

         $('#deleteStudents').click(function() {
             $('#Students :selected').each(function(i, selected) {
                 $(selected).remove();
             });
         });
     });


[jQuery] Re: autocomplete plugin not working in firefox

2009-12-30 Thread mary ann
Hi, good idea. I've now got Firebug and it does not show anything
relating to autocomplete.  Its like the scripts never get run at all.
But in ie, its fine.  Thanks for your help.

On Dec 30, 6:19 pm, MorningZ morni...@gmail.com wrote:
 Do you have FireBug installed (you should!) to see if the plugin at
 least tries to make the request?

 http://www.getfirebug.com

 On Dec 30, 8:23 pm, mary ann marya...@gmail.com wrote:



  I'm using the autocomplete plugin.  The following script works in IE,
  but doesn't work in Firefox.  It doesn't appear  that these are even
  being triggered.  So when the page displays in Firefox, the
  searchStudents textbox has no autocomplete associated with it.

  $(document).ready(function() {
      $('#searchStudents').autocomplete('%=Url.Action(Students,
  Student)%', {
              dataType: 'json',
              parse: function(data) {
                  var rows = new Array();
                  for (var i = 0; i  data.length; i++) {
                      rows[i] = { data: data[i], value: data
  [i].LastName, result: data[i].LastName };
                  }
                  return rows;
              },
              formatItem: function(row, i, n) {
                  return row.LastName + ' - ' + row.UserId;
              },
              width: 300,
              mustMatch: false,
              limit: 10
          });

          $('#searchStudents').result(function(event, data, formatted) {
              if (data)
                  $(this).parent().next().find(input).val(data
  [UserId]);
              $('#Students).append('option value=' + data[UserId] +
  '' + data[LastName] + '/option ');
          });

          $('#deleteStudents').click(function() {
              $('#Students :selected').each(function(i, selected) {
                  $(selected).remove();
              });
          });
      });- Hide quoted text -

 - Show quoted text -


[jQuery] Re: [AUTOCOMPLETE]

2009-12-27 Thread Ami
Yes.
try that:

$('select').focus(
function (){$(this).attr('size',5)}
).blur( function (){$(this).attr('size',0)} )

If it.. rate me please.

On Dec 23, 9:47 pm, Jake Moon jmalon...@gmail.com wrote:
 Is it possible to open the select list on focus?

 Best regards,

 Jake Moon


[jQuery] Re: [autocomplete]

2009-12-20 Thread nKognito
This problem occures only in IE (I have tested on IE 7)

On 19 дек, 21:01, nKognito vicmo...@gmail.com wrote:
 In your autocomplete plugin example (tags list): when a user types
 some word and then select the right one from the suggested list by
 keyboard - everything ok, BUT when he wants to select an option by
 mouse - there is a big problem - the input field recieves th wrong
 value. I have similar problem on my web site. What's the cure/ Thank
 you


[jQuery] Re: autocomplete remote data backspace behavior

2009-11-15 Thread Jas
its an option..

mustMatch: true,

so whenever backspace is pressed and the text changes, now it does not
match exactly so the whole string is erased. pretty cool!

On Nov 13, 4:52 pm, Jas mciver.ja...@gmail.com wrote:
 In the demohttp://view.jquery.com/trunk/plugins/autocomplete/demo/
 with Multiple Cities and Multiple birds there seems to be a difference
 in behavior when removing or backspacing the last entry.
 Is it possible to make the remote one act like the local one, where
 pressing the backspace removes the whole entry rather than each
 letter?

 Thanks


[jQuery] Re: Autocomplete - Is there a way?

2009-11-08 Thread MorningZ
 What I'm trying to figure out how to do - is to have an Add New
 option in the Autocomplete list that shows (at the top or bottom of
 the autocomplete list) as a selectable option, regardless of what the
 user is searching for.

Well, if you have the plugin working, then you obviously have the
server side coding complete.. you'd simply add this Add New to the
end of these results on the server



On Nov 8, 11:19 am, cdukes77 cduke...@bellsouth.net wrote:
 I'm using Autocomplete in a search field to reference and load a
 record from a database ... it's working perfectly, thank-you for
 making this UI concept so easy to accomplish ...

 Is there a way to have a special item return in the autocomplete
 list regardless of what the user types ... In other words something
 like ...

 Imagine a Movie database -- with a UI that allows you to type the
 movie name in an autocomplete enabled text area ... as you type the
 name ... possible matches are displayed and available for selection
 (so far, exactly as you would expect autocomplete to work)  ... but as
 you type, and the list continuously narrows, the user finds that the
 movie is not in the list ...

 What I'm trying to figure out how to do - is to have an Add New
 option in the Autocomplete list that shows (at the top or bottom of
 the autocomplete list) as a selectable option, regardless of what the
 user is searching for.

 I can obviously have an Add New option when the user types an
 a ... what I would like is for the Add New selectable option to
 show up in all circumstances.

 Thanks again,
 Chip


[jQuery] Re: Autocomplete - Is there a way?

2009-11-08 Thread cdukes77
Exactly ... the questions is how ... here;s the autocomplete script
I'm using - I cannot see any way to add a list item that is outside of
the loop AND part of the return ...

$(document).ready(function() {
$(#searchName).autocomplete(data, {
matchContains: true,
formatItem: function(item) {
return item.text;
}
}).result(function(event, item) {
location.href = item.url;
});
});

On Nov 8, 3:54 pm, MorningZ morni...@gmail.com wrote:
  What I'm trying to figure out how to do - is to have an Add New
  option in theAutocompletelist that shows (at the top or bottom of
  theautocompletelist) as a selectable option, regardless of what the
  user is searching for.

 Well, if you have the plugin working, then you obviously have the
 server side coding complete.. you'd simply add this Add New to the
 end of these results on the server

 On Nov 8, 11:19 am, cdukes77 cduke...@bellsouth.net wrote:



  I'm usingAutocompletein a search field to reference and load a
  record from a database ... it's working perfectly, thank-you for
  making this UI concept so easy to accomplish ...

  Is there a way to have a special item return in theautocomplete
  list regardless of what the user types ... In other words something
  like ...

  Imagine a Movie database -- with a UI that allows you to type the
  movie name in anautocompleteenabled text area ... as you type the
  name ... possible matches are displayed and available for selection
  (so far, exactly as you would expectautocompleteto work)  ... but as
  you type, and the list continuously narrows, the user finds that the
  movie is not in the list ...

  What I'm trying to figure out how to do - is to have an Add New
  option in theAutocompletelist that shows (at the top or bottom of
  theautocompletelist) as a selectable option, regardless of what the
  user is searching for.

  I can obviously have an Add New option when the user types an
  a ... what I would like is for the Add New selectable option to
  show up in all circumstances.

  Thanks again,
  Chip- Hide quoted text -

 - Show quoted text -


[jQuery] Re: Autocomplete - Is there a way?

2009-11-08 Thread MorningZ
Ah, local data on the page...

no idea, sorry


On Nov 8, 5:10 pm, cdukes77 cduke...@bellsouth.net wrote:
 Exactly ... the questions is how ... here;s the autocomplete script
 I'm using - I cannot see any way to add a list item that is outside of
 the loop AND part of the return ...

         $(document).ready(function() {
             $(#searchName).autocomplete(data, {
                 matchContains: true,
                 formatItem: function(item) {
                     return item.text;
                 }
             }).result(function(event, item) {
                 location.href = item.url;
             });
         });

 On Nov 8, 3:54 pm, MorningZ morni...@gmail.com wrote:

   What I'm trying to figure out how to do - is to have an Add New
   option in theAutocompletelist that shows (at the top or bottom of
   theautocompletelist) as a selectable option, regardless of what the
   user is searching for.

  Well, if you have the plugin working, then you obviously have the
  server side coding complete.. you'd simply add this Add New to the
  end of these results on the server

  On Nov 8, 11:19 am, cdukes77 cduke...@bellsouth.net wrote:

   I'm usingAutocompletein a search field to reference and load a
   record from a database ... it's working perfectly, thank-you for
   making this UI concept so easy to accomplish ...

   Is there a way to have a special item return in theautocomplete
   list regardless of what the user types ... In other words something
   like ...

   Imagine a Movie database -- with a UI that allows you to type the
   movie name in anautocompleteenabled text area ... as you type the
   name ... possible matches are displayed and available for selection
   (so far, exactly as you would expectautocompleteto work)  ... but as
   you type, and the list continuously narrows, the user finds that the
   movie is not in the list ...

   What I'm trying to figure out how to do - is to have an Add New
   option in theAutocompletelist that shows (at the top or bottom of
   theautocompletelist) as a selectable option, regardless of what the
   user is searching for.

   I can obviously have an Add New option when the user types an
   a ... what I would like is for the Add New selectable option to
   show up in all circumstances.

   Thanks again,
   Chip- Hide quoted text -

  - Show quoted text -


[jQuery] Re: [autocomplete] Callback for selected match

2009-10-15 Thread Evgeny Bobovik

use the onchange event for select
   Gk___




2009/10/14 eka ekagauranga...@gmail.com:

 Hi

 Is there anyway to pass a callback to the options to be called when an
 option is selected?

 Regards

 Eka



[jQuery] Re: Autocomplete plugin: results as table?

2009-10-14 Thread Maarten

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


[jQuery] Re: Autocomplete not working in Firefox

2009-10-14 Thread vrodg

Also it's Firefox on both Platforms of PC and Mac it is not working.
The firefox versions used for testing is 3.5.3



On Oct 14, 10:36 am, vrodg vance.rodg...@gmail.com wrote:
 I can get Jquery Autocomplete to work in all browsers but Firefox.
 The function correctly queries the data and creates the results div/
 list, but it's not setting the style: display to show or block, it's
 remaining at none, the default state. Firebug is not showing me any
 errors, as far as its concerned it's running just fine.  Any thoughts?


[jQuery] Re: Autocomplete not working in Firefox

2009-10-14 Thread MorningZ

I use the plugin just fine against Firefox 3.5

Got some example code?
Have you tried to view another instance of the plugin from your
Firefox install? (like for instance the demo page)


On Oct 14, 1:38 pm, vrodg vance.rodg...@gmail.com wrote:
 Also it's Firefox on both Platforms of PC and Mac it is not working.
 The firefox versions used for testing is 3.5.3

 On Oct 14, 10:36 am, vrodg vance.rodg...@gmail.com wrote:

  I can get Jquery Autocomplete to work in all browsers but Firefox.
  The function correctly queries the data and creates the results div/
  list, but it's not setting the style: display to show or block, it's
  remaining at none, the default state. Firebug is not showing me any
  errors, as far as its concerned it's running just fine.  Any thoughts?


[jQuery] Re: Autocomplete not working in Firefox

2009-10-14 Thread vrodg

I found the issue.  the original developer of the site had a separate
CSS called in for Firefox.  I was attempting to perform actions
against classes that did not exist.



On Oct 14, 10:40 am, MorningZ morni...@gmail.com wrote:
 I use the plugin just fine against Firefox 3.5

 Got some example code?
 Have you tried to view another instance of the plugin from your
 Firefox install? (like for instance the demo page)

 On Oct 14, 1:38 pm, vrodg vance.rodg...@gmail.com wrote:



  Also it's Firefox on both Platforms of PC and Mac it is not working.
  The firefox versions used for testing is 3.5.3

  On Oct 14, 10:36 am, vrodg vance.rodg...@gmail.com wrote:

   I can get Jquery Autocomplete to work in all browsers but Firefox.
   The function correctly queries the data and creates the results div/
   list, but it's not setting the style: display to show or block, it's
   remaining at none, the default state. Firebug is not showing me any
   errors, as far as its concerned it's running just fine.  Any thoughts?


[jQuery] Re: Autocomplete plugin: results as table?

2009-10-14 Thread alexbodn . groups

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 - How to simulate a select box, where displayed value is one thing and submitted value is another

2009-10-13 Thread chrishubbard

Eric,
You need to use formatItem.

http://docs.jquery.com/Plugins/Autocomplete/autocomplete#url_or_dataoptions

For example, let's assume that the JSON you are returning from your
server script looks like (taken from the example data):
[
{ name: Peter Pan, to: pe...@pan.de },
{ name: Molly, to: mo...@yahoo.com }
]

And you only want to display the 'name' part and use the 'to' part as
the value.

First change the formatItem to something like:
formatItem: function(row, i, max) {
return row.name;
},

And change the formatMatch to something like:
formatMatch: function(row, i, max) {
return row.name;
}

Here's the modified code from the example that's included in the
plugin:
$(#suggest13).autocomplete(emails, {
minChars: 0,
width: 310,
matchContains: word,
autoFill: false,
formatItem: function(row, i, max) {
return row.name;
},
formatMatch: function(row, i, max) {
return row.to;
},
formatResult: function(row) {
return row.to;
}
});

There are other ways to do what's shown above, but I think that's the
easiest.
hope that helps.
Chris

On Oct 5, 2:16 pm, benze ebenza...@gmail.com wrote:
 Hi,

 I'm trying to figure out how to use theautocompletejQuery plugin
 best to my needs.  I'm looking to replace a select box with 
 theAutocompleteplugin, 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 theautocomplete, 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


[jQuery] Re: Autocomplete plugin: results as table?

2009-10-12 Thread alexbodn . groups

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 Sends Null To Server Side Function

2009-10-08 Thread MorningZ

Are you using firebug or another Developer Console like program to see
what request the AutoComplete is sending out?

it should be something like

http://yourwebsite/Serice/AutoComplete.ashx?q=foolimit=10timestamp=1255013315384

And all values can be accessed in ASP.NET via Request.QueryString, key
q has the value to search on


On Oct 7, 10:50 pm, Mark Phillips mgphilli...@gmail.com wrote:
 Hi,

 I'm using the AutoComplete Plugin with ASP.NET MVC.  For some reason
 the client side input value is NULL when it reaches the Server method.

 Any suggestions would be appreciated.

 Thanks,
 Mark


[jQuery] Re: AutoComplete Sends Null To Server Side Function

2009-10-08 Thread Mark Phillips

Thanks for the reply.

I discovered the answer.  A silly mistake actually.  The AutoComplete
parameter is q.  ASP.NET MVC Routes needs an exact parameter name
match on the server side method.  I was using the word filter
instead of q, so ASP.NET MVC passed in null to the server method.

Mark



On Oct 8, 10:45 am, MorningZ morni...@gmail.com wrote:
 Are you using firebug or another Developer Console like program to see
 what request the AutoComplete is sending out?

 it should be something like

 http://yourwebsite/Serice/AutoComplete.ashx?q=foolimit=10×tamp=...

 And all values can be accessed in ASP.NET via Request.QueryString, key
 q has the value to search on

 On Oct 7, 10:50 pm, Mark Phillips mgphilli...@gmail.com wrote:



  Hi,

  I'm using the AutoComplete Plugin with ASP.NET MVC.  For some reason
  the client side input value is NULL when it reaches the Server method.

  Any suggestions would be appreciated.

  Thanks,
  Mark- Hide quoted text -

 - Show quoted text -


[jQuery] Re: (autocomplete) help about extraparams

2009-10-07 Thread Otniel Zebua
Thanks alex, it works.

On Wed, Oct 7, 2009 at 7:20 AM, alexbodn.gro...@gmail.com wrote:

 please try cacheLength=0 arg to autocomplete.




[jQuery] Re: autocomplete question

2009-10-07 Thread Bjarki

I found out there is a formatMatch function.

formatMatch: function(row) { return row.N; }

it's just not in the documentation

On Oct 7, 10:50 am, Bjarki bjar...@gmail.com wrote:
 I am looking at the auto-complete demo page, 
 (http://view.jquery.com/trunk/plugins/autocomplete/demo/) on the demo
 of remote images.
 the Javascript for that is
 $(#imageSearch).autocomplete(images.php, {
                 width: 320,
                 max: 4,
                 highlight: false,
                 scroll: true,
                 scrollHeight: 300,
                 formatItem: function(data, i, n, value) {
                         return img src='images/ + value + '/  + 
 value.split(.)[0];
                 },
                 formatResult: function(data, value) {
                         return value.split(.)[0];
                 }
         });

 my problem is that when I try to implement this. it will only search
 for the data that is first in the string. so if  I have a span +
 data.N /span  I have to type in span to see any results, how to I
 configure this to just match the data.N ?

 function getEmpSuccess(data){
         eval(empColl =  + data + ;);
         $(input[id$='query']).autocomplete(empColl[E], {
                                         formatItem: function(data) {

                                                 var rts = data.N;
                                                 rts +='div class=color' + 
 data.W + 'nbsp;/divbr /';
                                                 rts += sub + data.S + 
 /sub;

                                                 return rts;
                                         },
                                         formatResult: function(item, value) {
                                                 return item.N;
                                         },
                                         selectFirst: false,
                                         max: 5
                                 });

 }


[jQuery] Re: Autocomplete plugin: results as table?

2009-10-07 Thread Maarten

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.


[jQuery] Re: (autocomplete)

2009-10-07 Thread Alberto SOUZA
Hi, i resolved the probleam, actually, i was looking for in the wrong place.
I had to use the parse function to solve the problem when i get json from
the server. Thanks!

On Wed, Oct 7, 2009 at 11:22 AM, Alberto alots@gmail.com wrote:


 I'm trying to use the plugin with generated json, but the parse isn't
 going very well... My json, that is being produced is something like
 that:
 [ { id: 9887, nome: Salvador, estado: BA }, { id:
 9890, nome: Salvaterra, estado: PA }, { id: 9888,
 nome: Salvador das Missões, estado: RS }, { id: 9889,
 nome: Salvador do Sul, estado: RS } ]. Is there something
 wrong? i tried to pass my formarItem function but did not work, the
 plugin is not parsing my json... I looked for some reason into source
 code but i did not found.

 Thanks,

 Alberto



[jQuery] Re: Autocomplete - How to simulate a select box, where displayed value is one thing and submitted value is another

2009-10-06 Thread alexbodn . groups

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

2009-10-06 Thread alexbodn . groups

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 click send focus back to input

2009-10-02 Thread travisjbeck

I figured it out

$(#myinput).autocomplete(_url,{
 onItemSelect: function(){
$('#myinput').focus();
 }
});

although i couldnt find onItemSelect anywhere in the documentation

On Oct 1, 8:46 pm, travisjbeck smoothopera...@gmail.com wrote:
 are there any callbacks for me to hook into in order to send the focus
 (); back to my input box when someone selects or clicks and
 autocomplete item?


[jQuery] Re: (autocomplete) help about extraparams

2009-10-01 Thread James

I don't see what the problem is and what you want help on. You have
the code right there that essentially does what you want.
You just have to build the server-side code to select only cities with
the selected country and a match to the autocomplete text.
... or did you want someone to build all of that for you?

On Oct 1, 6:41 am, pragard otn...@gmail.com wrote:
 Hi, i'm trying the jquery autocomplete from here

 http://docs.jquery.com/Plugins/Autocomplete

 On that page someone said that:
 
 Often one autocompleted field depends on the value of another field.
 In that case, the extraParams option can provide the necessary dynamic
 parameter:

 Consider an example where the states-field reuses the value entered
 into the country field
 

 And the examples was:
 
 $(#states).autocomplete(url, {
    extraParams: {
        country: function() { return $(#country).val(); }
    }
 

 What I'm trying to do is I made a combo box that contain country with
 it's id, and I also have a input text that will do the autocomplete.
 If I select one of the country from the combo box, I want input text
 will show me, when I press some words with autocomplete function, all
 of the city that include in that country (assuming I have it in my
 database).

 What should I do? Can someone give me some examples?

 Thanks.


[jQuery] Re: (autocomplete) help about extraparams

2009-10-01 Thread Otniel Zebua
Thanks for your replies.

I know that in the example, there is a server-side code called search.php
that list all of the autocomplete list. And in that files the words that we
type was get by $_GET['q'].
Now my problem is, as I mentioned before, that it can pass the country ID
with extra params, but how do I get the country ID in the search.php files
so I can list all my city based on the country that I choose? What parameter
did the server-side code get for the country ID. I have try $_POST and $_GET
and got nothing.

If I use the example I mentioned before

$(#states).autocomplete(url, {
extraParams: {
   country: function() { return $(#country).val(); }
   }

what parameter should I get in the server-side code?

I'm sorry Jack, because I'm really new in javascript :D
Once again thanks for your help.

Regards,


On Fri, Oct 2, 2009 at 2:12 AM, James james.gp@gmail.com wrote:


 I don't see what the problem is and what you want help on. You have
 the code right there that essentially does what you want.
 You just have to build the server-side code to select only cities with
 the selected country and a match to the autocomplete text.
 ... or did you want someone to build all of that for you?

 On Oct 1, 6:41 am, pragard otn...@gmail.com wrote:
  Hi, i'm trying the jquery autocomplete from here
 
  http://docs.jquery.com/Plugins/Autocomplete
 
  On that page someone said that:
  
  Often one autocompleted field depends on the value of another field.
  In that case, the extraParams option can provide the necessary dynamic
  parameter:
 
  Consider an example where the states-field reuses the value entered
  into the country field
  
 
  And the examples was:
  
  $(#states).autocomplete(url, {
 extraParams: {
 country: function() { return $(#country).val(); }
 }
  
 
  What I'm trying to do is I made a combo box that contain country with
  it's id, and I also have a input text that will do the autocomplete.
  If I select one of the country from the combo box, I want input text
  will show me, when I press some words with autocomplete function, all
  of the city that include in that country (assuming I have it in my
  database).
 
  What should I do? Can someone give me some examples?
 
  Thanks.



[jQuery] Re: (autocomplete) help about extraparams

2009-10-01 Thread MorningZ

First off, you should use Firefox and Firebug (or Chrome/Safari with
their respective Developer Consoles) to look at the URL That the
autocomplete call actually calls...

the extraParams get appended onto the URL as a query string value...
there's no reason why $_GET wouldn't work to get the value unless you
have something coded incorrectly


On Oct 1, 9:10 pm, Otniel Zebua otn...@gmail.com wrote:
 Thanks for your replies.

 I know that in the example, there is a server-side code called search.php
 that list all of the autocomplete list. And in that files the words that we
 type was get by $_GET['q'].
 Now my problem is, as I mentioned before, that it can pass the country ID
 with extra params, but how do I get the country ID in the search.php files
 so I can list all my city based on the country that I choose? What parameter
 did the server-side code get for the country ID. I have try $_POST and $_GET
 and got nothing.

 If I use the example I mentioned before
 
 $(#states).autocomplete(url, {
     extraParams: {
        country: function() { return $(#country).val(); }
    }
 
 what parameter should I get in the server-side code?

 I'm sorry Jack, because I'm really new in javascript :D
 Once again thanks for your help.

 Regards,

 On Fri, Oct 2, 2009 at 2:12 AM, James james.gp@gmail.com wrote:

  I don't see what the problem is and what you want help on. You have
  the code right there that essentially does what you want.
  You just have to build the server-side code to select only cities with
  the selected country and a match to the autocomplete text.
  ... or did you want someone to build all of that for you?

  On Oct 1, 6:41 am, pragard otn...@gmail.com wrote:
   Hi, i'm trying the jquery autocomplete from here

  http://docs.jquery.com/Plugins/Autocomplete

   On that page someone said that:
   
   Often one autocompleted field depends on the value of another field.
   In that case, the extraParams option can provide the necessary dynamic
   parameter:

   Consider an example where the states-field reuses the value entered
   into the country field
   

   And the examples was:
   
   $(#states).autocomplete(url, {
      extraParams: {
          country: function() { return $(#country).val(); }
      }
   

   What I'm trying to do is I made a combo box that contain country with
   it's id, and I also have a input text that will do the autocomplete.
   If I select one of the country from the combo box, I want input text
   will show me, when I press some words with autocomplete function, all
   of the city that include in that country (assuming I have it in my
   database).

   What should I do? Can someone give me some examples?

   Thanks.


[jQuery] Re: (autocomplete) help about extraparams

2009-10-01 Thread James

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'; }
   }

On Oct 1, 3:13 pm, MorningZ morni...@gmail.com wrote:
 First off, you should use Firefox and Firebug (or Chrome/Safari with
 their respective Developer Consoles) to look at the URL That the
 autocomplete call actually calls...

 the extraParams get appended onto the URL as a query string value...
 there's no reason why $_GET wouldn't work to get the value unless you
 have something coded incorrectly

 On Oct 1, 9:10 pm, Otniel Zebua otn...@gmail.com wrote:

  Thanks for your replies.

  I know that in the example, there is a server-side code called search.php
  that list all of the autocomplete list. And in that files the words that we
  type was get by $_GET['q'].
  Now my problem is, as I mentioned before, that it can pass the country ID
  with extra params, but how do I get the country ID in the search.php files
  so I can list all my city based on the country that I choose? What parameter
  did the server-side code get for the country ID. I have try $_POST and $_GET
  and got nothing.

  If I use the example I mentioned before
  
  $(#states).autocomplete(url, {
      extraParams: {
         country: function() { return $(#country).val(); }
     }
  
  what parameter should I get in the server-side code?

  I'm sorry Jack, because I'm really new in javascript :D
  Once again thanks for your help.

  Regards,

  On Fri, Oct 2, 2009 at 2:12 AM, James james.gp@gmail.com wrote:

   I don't see what the problem is and what you want help on. You have
   the code right there that essentially does what you want.
   You just have to build the server-side code to select only cities with
   the selected country and a match to the autocomplete text.
   ... or did you want someone to build all of that for you?

   On Oct 1, 6:41 am, pragard otn...@gmail.com wrote:
Hi, i'm trying the jquery autocomplete from here

   http://docs.jquery.com/Plugins/Autocomplete

On that page someone said that:

Often one autocompleted field depends on the value of another field.
In that case, the extraParams option can provide the necessary dynamic
parameter:

Consider an example where the states-field reuses the value entered
into the country field


And the examples was:

$(#states).autocomplete(url, {
   extraParams: {
       country: function() { return $(#country).val(); }
   }


What I'm trying to do is I made a combo box that contain country with
it's id, and I also have a input text that will do the autocomplete.
If I select one of the country from the combo box, I want input text
will show me, when I press some words with autocomplete function, all
of the city that include in that country (assuming I have it in my
database).

What should I do? Can someone give me some examples?

Thanks.




[jQuery] Re: (autocomplete) help about extraparams

2009-10-01 Thread Otniel Zebua
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'; }
}



[jQuery] Re: (autocomplete) multiple inputbox using same autocomplete function

2009-10-01 Thread Amit

I know that we can use multiple selector in autocomplete function but
we can't access them in result function.



On Oct 2, 11:30 am, Amit amit.aggar...@gmail.com wrote:
 code at the bottom is working fine .. wherein data is coming from
 database via postcode.php in following format :

 2221|BLAKEHURST|NSW
 4401|ACKLAND|QLD
 2221|BLAKEHURST|NSW
 4401|ACKLAND|QLD
 2221|BLAKEHURST|NSW
 4401|ACKLAND|QLD

 Now issue is I have multiple postalcode, city and state input box in
 my code in same page like :

 input type=text id=postalcode /
 input type=text id=city /
 input type=text id=state /

 input type=text id=postalcodex /
 input type=text id=cityx /
 input type=text id=statex /

 input type=text id=postalcodey /
 input type=text id=cityy /
 input type=text id=statey /

 How should I go in this case ??

 I just don't want to repeat the javascript code for them. Is there any
 way I can pass variable seelctors and can get back result in same
 way ?

 -

 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
                     http://www.w3.org/TR/html4/loose.dtd;
 html
 head
   script src=http://code.jquery.com/jquery-latest.js;/script
   link rel=stylesheet href=http://dev.jquery.com/view/trunk/
 plugins/autocomplete/demo/main.css type=text/css /
   link rel=stylesheet href=http://dev.jquery.com/view/trunk/
 plugins/autocomplete/jquery.autocomplete.css type=text/css /
   script type=text/javascript src=http://dev.jquery.com/view/trunk/
 plugins/autocomplete/lib/jquery.bgiframe.min.js/script
   script type=text/javascript src=http://dev.jquery.com/view/trunk/
 plugins/autocomplete/lib/jquery.dimensions.js/script
   script type=text/javascript src=js/jquery.autocomplete.js/
 script
   script

   $(document).ready(function(){

 $(#postalcode).autocomplete(inc/postcode.php, {
                 width: 260,
                 selectFirst: false,
                 formatItem: function(data, i, n, value) {
                 return data[0] + , + data[1] + , + data[2];
                 }
         });

 $(#postalcode).result(function(event, data, formatted) {
                 if (data)
                         {
                         $(input#postalcode).val(data[0]);
                         $(input#city).val(data[1]);
                         $(input#state).val(data[2]);
                         }

         });

   });
   /script

 /head
 body
 input type=text id=postalcode /
 input type=text id=city /
 input type=text id=state /

 /body
 /html


[jQuery] Re: (autocomplete) not selecting value unless user explicitly selects it

2009-09-30 Thread Mike Wertheim
I'm realizing that I didn't describe this completely enough.

I'm putting together a search engine.  So I need text field (with
autocomplete) and a Search button.  When the user presses return, it should
submit the form (i.e. the equivalent of clicking the Search button).  When
the user explicitly selects a value from the autocomplete drop-down, I want
the text field to be updated with that value and the form to be submitted.

If the user has typed something and presses return, the form should be
submitted, but the auto complete code should not update the text field's
value, since the user didn't explicitly select the autocomplete's value.

Is this do-able?


On Wed, Sep 30, 2009 at 12:22 PM, mikewertheim m...@hyperreal.org wrote:


 I'm using the jquery autocomplete plugin.

 Suppose the user starts typing, and the autocomplete presents a drop-
 down of possible values.  If the user presses return, the first value
 in the drop-down is selected.

 What I want instead is the user experience that Firefox's search box
 provides: As the user types, search suggestions are offered.  If the
 user presses return without selecting a suggestion, what the user has
 typed so far is submitted.  And of course, if the user does explicitly
 select a value from the drop-down, then the selected value is
 submitted.

 Is there a way to make jquery autocomplete do that?



[jQuery] Re: autocomplete, extraParams and $(this)

2009-09-29 Thread patrickk

I would like to send the ID of the autocomplete-field to the ajax-
script.
I thought that $(this) refers to the input-field (having my initial
example in mind).

isn´t it possible to use $(this) within the autocompleter? how would
you pass the ID of the current autocomplete-field to the ajax-script
(assuming that you have several autocomplete-fields on one page)?

thanks,
patrick


On 29 Sep., 02:35, James james.gp@gmail.com wrote:
 By the way,
 'extra_var': function() {
     return $(#extra_var).attr('id');

 }

 Would return extra_var since $(#extra_var).attr('id'); is
 extra_var.
 I'm not sure what you're trying to achieve if that's not what you
 want.

 On Sep 28, 2:34 pm, James james.gp@gmail.com wrote:

  extra_var does not map to the ID of the input field. It is the name
  that is going to be sent along with the AJAX request to your script.
  (e.g. /autocomplete_lookup/?
  q=my_search_text_blahablhablahextra_var=12345)

  You have to change it so it's:
  'extra_var': function() {
      return $(#extra_var).attr('id');

  }

  On Sep 26, 8:39 am, patrickk patr...@vonautomatisch.at wrote:

   I´m a bit confused, because the following doesn´t seem to work and I
   have no idea why ... after searching google for a couple of hours and
   trying different solutions, I´m posting this here and hope that
   someone can help.

       $(input.vAutocompleteField).autocomplete('/
   autocomplete_lookup/', {
           highlight: false,
           mustMatch: false,
           matchContains: true,
           cacheLength: 20,
           minChars: 2,
           extraParams: {
               'extra_var': function() {
                   return $(this).attr('id');
               }
           }
       });

   extra_var should be the ID of the current input-field.

   this is probably just me don´t seeing what´s wrong ... so any help is
   appreciated.

   thanks,
   patrick




[jQuery] Re: autocomplete

2009-09-29 Thread Nalum

is return $.map(data, function(row)  passing the json variable to
data or row?

it looks to me like row is an empty variable.

On Sep 29, 1:13 pm, Asa Carter asa_car...@hotmail.com wrote:
 Hi

 My php is returning via json:

 a string (name) which is displayed in the text box
 an int (location_id)

 When the form is posted I would also like to post 'location_id' as
 well as / instead of 'name'.

 My js is below. what do I need to do to be able to post the
 location_id.

         $(#quick-search).autocomplete('/includes/search.php', {
                 width: 300,
                 scroll: false,
                 dataType: json,
                 parse: function(data) {
                         return $.map(data, function(row) {
                                 return {
                                         data: row,
                                         value: row.location_id,
                                         result: row.name
                                 }
                         });
                 },
                 formatItem: function(mail) {
                         return mail.name;
                 }
         });

 Thanks

 Asa


[jQuery] Re: autocomplete

2009-09-29 Thread Asa Carter

It's working :)

$(#quick-search).autocomplete('/includes/search.php',{
width: 300,
scroll: false,
dataType: json,
parse: function(data){
return $.map(data, function(row){
return{
data: row,
value: row.location_id,
result: row.location
}
});
},
formatItem: function(result){
return result.location;
}
}).result(function(e, item) {
$('#location_id').attr('value',item.location_id);
});


[jQuery] Re: autocomplete, extraParams and $(this)

2009-09-29 Thread James

I think it's just not in the scope. I haven't looked into it.
How about looping through each result set and assigning the option
individually.
In addition to your autocomplete initialization code, add this (not
tested):

$(input.vAutocompleteField).each(function() {
var field = this;
$(field).setOptions({
extraParams: {
extra_var: function() { return field.id; }
}
});
});

On Sep 28, 10:00 pm, patrickk patr...@vonautomatisch.at wrote:
 I would like to send the ID of the autocomplete-field to the ajax-
 script.
 I thought that $(this) refers to the input-field (having my initial
 example in mind).

 isn´t it possible to use $(this) within the autocompleter? how would
 you pass the ID of the current autocomplete-field to the ajax-script
 (assuming that you have several autocomplete-fields on one page)?

 thanks,
 patrick

 On 29 Sep., 02:35, James james.gp@gmail.com wrote:

  By the way,
  'extra_var': function() {
      return $(#extra_var).attr('id');

  }

  Would return extra_var since $(#extra_var).attr('id'); is
  extra_var.
  I'm not sure what you're trying to achieve if that's not what you
  want.

  On Sep 28, 2:34 pm, James james.gp@gmail.com wrote:

   extra_var does not map to the ID of the input field. It is the name
   that is going to be sent along with the AJAX request to your script.
   (e.g. /autocomplete_lookup/?
   q=my_search_text_blahablhablahextra_var=12345)

   You have to change it so it's:
   'extra_var': function() {
       return $(#extra_var).attr('id');

   }

   On Sep 26, 8:39 am, patrickk patr...@vonautomatisch.at wrote:

I´m a bit confused, because the following doesn´t seem to work and I
have no idea why ... after searching google for a couple of hours and
trying different solutions, I´m posting this here and hope that
someone can help.

    $(input.vAutocompleteField).autocomplete('/
autocomplete_lookup/', {
        highlight: false,
        mustMatch: false,
        matchContains: true,
        cacheLength: 20,
        minChars: 2,
        extraParams: {
            'extra_var': function() {
                return $(this).attr('id');
            }
        }
    });

extra_var should be the ID of the current input-field.

this is probably just me don´t seeing what´s wrong ... so any help is
appreciated.

thanks,
patrick




[jQuery] Re: autocomplete, extraParams and $(this)

2009-09-28 Thread James

extra_var does not map to the ID of the input field. It is the name
that is going to be sent along with the AJAX request to your script.
(e.g. /autocomplete_lookup/?
q=my_search_text_blahablhablahextra_var=12345)

You have to change it so it's:
'extra_var': function() {
return $(#extra_var).attr('id');
}


On Sep 26, 8:39 am, patrickk patr...@vonautomatisch.at wrote:
 I´m a bit confused, because the following doesn´t seem to work and I
 have no idea why ... after searching google for a couple of hours and
 trying different solutions, I´m posting this here and hope that
 someone can help.

     $(input.vAutocompleteField).autocomplete('/
 autocomplete_lookup/', {
         highlight: false,
         mustMatch: false,
         matchContains: true,
         cacheLength: 20,
         minChars: 2,
         extraParams: {
             'extra_var': function() {
                 return $(this).attr('id');
             }
         }
     });

 extra_var should be the ID of the current input-field.

 this is probably just me don´t seeing what´s wrong ... so any help is
 appreciated.

 thanks,
 patrick


[jQuery] Re: autocomplete, extraParams and $(this)

2009-09-28 Thread James

By the way,
'extra_var': function() {
return $(#extra_var).attr('id');
}

Would return extra_var since $(#extra_var).attr('id'); is
extra_var.
I'm not sure what you're trying to achieve if that's not what you
want.


On Sep 28, 2:34 pm, James james.gp@gmail.com wrote:
 extra_var does not map to the ID of the input field. It is the name
 that is going to be sent along with the AJAX request to your script.
 (e.g. /autocomplete_lookup/?
 q=my_search_text_blahablhablahextra_var=12345)

 You have to change it so it's:
 'extra_var': function() {
     return $(#extra_var).attr('id');

 }

 On Sep 26, 8:39 am, patrickk patr...@vonautomatisch.at wrote:

  I´m a bit confused, because the following doesn´t seem to work and I
  have no idea why ... after searching google for a couple of hours and
  trying different solutions, I´m posting this here and hope that
  someone can help.

      $(input.vAutocompleteField).autocomplete('/
  autocomplete_lookup/', {
          highlight: false,
          mustMatch: false,
          matchContains: true,
          cacheLength: 20,
          minChars: 2,
          extraParams: {
              'extra_var': function() {
                  return $(this).attr('id');
              }
          }
      });

  extra_var should be the ID of the current input-field.

  this is probably just me don´t seeing what´s wrong ... so any help is
  appreciated.

  thanks,
  patrick




[jQuery] Re: [autocomplete] auto complete based on additional input value

2009-09-26 Thread alexbodn . groups


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)

2009-09-25 Thread Cyril Lopez
2009/9/24 Ordos segers.j...@gmail.com


 But now, when I start to type a country I get ALL special characters
 like: Belgi�


utf8_encode() ?
http://fr.php.net/manual/en/function.utf8-encode.php

Cyril


[jQuery] Re: Autocomplete

2009-09-21 Thread Liam Potter


why not restyle the strong tag?

Asa Carter wrote:

How do I use the highlight function in the auto complete plugin?

I wish to replace strong/strong with span class=blah../span

Thanks

Asa
  




[jQuery] Re: Autocomplete

2009-09-21 Thread fu zhiping
Hi, Asa

If the link below may help you, it is my pleasure.
http://www.donotyet.com/2009/08/30/3-examples-of-facebook-like-autosuggestion/


2009/9/21 Asa Carter asa_car...@hotmail.com


 How do I use the highlight function in the auto complete plugin?

 I wish to replace strong/strong with span class=blah../span

 Thanks

 Asa



[jQuery] Re: Autocomplete

2009-09-21 Thread Asa Carter

I suppose I could do that. thanks...

On Sep 21, 3:31 pm, Liam Potter radioactiv...@gmail.com wrote:
 why not restyle the strong tag?

 Asa Carter wrote:
  How do I use the highlight function in the auto complete plugin?

  I wish to replace strong/strong with span class=blah../span

  Thanks

  Asa


[jQuery] Re: [autocomplete] Does it support version 1.3.2?

2009-09-19 Thread alexbodn . groups

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: (autocomplete) how to have autocomplete use dynamic data (for implementing a search engine's entry field)

2009-09-16 Thread lanxiazhi
your server routine is just a web page,wait for the browser to request.you
set up the autocomplete like this:
$(..).autocomplete(web_page_url,{options..}).every time when the user press
a key,autocomplete will make a request to your web page,you fetch the
parameter  q,and you will know what the user have put in the autocomplete
textfield.then you run your routine,and at last,write the response like
this:
fog
fox
one item a line,so autocomplete will know.

the autocomplete plugin bundle file comes with some .php files,that is
server-side code,you can review it.


[jQuery] Re: Autocomplete plugin - customization

2009-09-14 Thread Dhruva Sagar
Hi,
Which autocomplete plugin are you using ?

Thanks  Regards,
Dhruva Sagar.


Mike Ditka http://www.brainyquote.com/quotes/authors/m/mike_ditka.html  -
If God had wanted man to play soccer, he wouldn't have given us arms.

On Mon, Sep 14, 2009 at 1:57 PM, 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?


[jQuery] Re: Autocomplete plugin - customization

2009-09-14 Thread alexbodn . groups

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: Autocomplete -- Autofill Comma Seperator Issues

2009-09-13 Thread Mil

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?


[jQuery] Re: Autocomplete -- Autofill Comma Seperator Issues

2009-09-13 Thread alexbodn . groups

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

2009-09-12 Thread alexbodn . groups

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

2009-09-12 Thread Joao Gilberto Magalhaes
Really Thanks! It is so easy!

2009/9/11 alexbodn.gro...@gmail.com

 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




[jQuery] Re: [Autocomplete] Receiving data in XML

2009-09-11 Thread Joao Gilberto Magalhaes
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




jquery.autocomplete.js
Description: JavaScript source


[jQuery] Re: [Autocomplete] Receiving data in XML

2009-09-11 Thread alexbodn . groups

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

2009-09-11 Thread Joao Gilberto Magalhaes
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




[jQuery] Re: [Autocomplete] Receiving data in XML

2009-09-11 Thread alexbodn . groups

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: [autocomplete] a few improvements to autocomplete

2009-09-10 Thread alexbodn . groups



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: [Autocomplete] Receiving data in XML

2009-09-10 Thread alexbodn . groups

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

2009-09-10 Thread alexbodn . groups

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

2009-09-10 Thread alexbodn . groups

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

2009-09-10 Thread alexbodn . groups

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

2009-09-10 Thread alexbodn . groups

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] key - value

2009-09-09 Thread alexbodn . groups

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

2009-09-09 Thread ripcurlksm


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.



[jQuery] Re: Autocomplete: implement result() to link a selection

2009-09-09 Thread alexbodn . groups

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?

2009-09-09 Thread alexbodn . groups

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 plugin - Hide completion list on Enter

2009-09-08 Thread janid1967

Found solution myself.
I'm using onkeypress=return checkEnter(this,event); on the
autocompletion input field.
The checkEnter function is taken from 
http://jennifermadden.com/javascript/stringEnterKeyDetector.html

Inside checkEnter, I'm running this code to hide any autocompletion
div's:
$(.ac_results).css(display, none);


On 7 Sep, 20:50, janid1967 janid1...@gmail.com wrote:
 Hi, I've just started using the jQuery Autocomplete plugin (http://
 docs.jquery.com/Plugins/Autocomplete).
 I get my completions from a serverside service. Currently I'm using
 the option selectFirst: false.

 When I'm using Enter without selecting from the completion list, this
 submits my form. This is fine, but the displayed completions stay
 visible after submit. How can I hide displayed completions when
 hitting Enter without selecting a entry?
 (As expected, displayed completion list disappear when selecting a
 entry and hit Enter or Tab)

 Please advice
 JI


[jQuery] Re: autocomplete accents

2009-09-07 Thread alexbodn . groups

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: Autocomplete -- Autofill Comma Seperator Issues

2009-09-07 Thread Patrick Wolf

Hi,

have you tried to set the option selectFirst to false?

Regards
Patrick

On Sep 3, 8:15 am, Mil formboardem...@wdoenterprises.com wrote:
 Does anyone have any ideas for this issue?

 On Sep 1, 4:49 am, Mil formboardem...@wdoenterprises.com wrote:



  Hi,

  I am trying to use this 
  autocompletehttp://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
 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?


[jQuery] Re: Autocomplete -- Autofill Comma Seperator Issues

2009-09-03 Thread Mil

Does anyone have any ideas for this issue?

On Sep 1, 4:49 am, Mil formboardem...@wdoenterprises.com wrote:
 Hi,

 I am trying to use this 
 autocompletehttp://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?


[jQuery] Re: (autocomplete) Is it possible to cache the empty results ?

2009-09-03 Thread mathieuuu

Does somebody has any idea ?

On 31 août, 15:28, mathieuuu mathie...@gmail.com wrote:
 Hi,

 Thanks for your answer rupak but I tried your fix and it did not give
 the expected result.
 On the contrary, now I think that the plug in is no longer using
 cache, even for non-empty results...

 On 31 août, 13:58, rupak mandal rupakn...@gmail.com wrote:

  Hi ,
  you have to make a little changes in autocomplete.js

  Search for *if (data  data.length*) condition which is inside request
  function. Add this code before the *if * condition

  if(data)
      data.length=0;

  Thanks
  Rupak

  On Mon, Aug 31, 2009 at 3:36 PM, mathieuuu mathie...@gmail.com wrote:

   Hello,

   I am currently using the jquery autocomplete ($Id:
   jquery.autocomplete.js 5785 2008-07-12 10:37:33Z) with remote data.

   Obviously I did not disabled the cache and matchSubset option (all
   matches of foot are a subset of all matches for foo), which
   reduces the number of queries made to the server.

   This is working well except in one case : if foo returns an empty
   result set, continue by typing foot will still generate another
   query to the server ...
   From my point of view this shouldn't be useful (if foo doesn't
   return results, foot won't either) and I am looking for a way to
   have the same cache usage with empty result as with not-empty
   results.

   Does anyone have an idea of how this could be done or knows the reason
   why there is this difference of behaviour ?

   Thank you a lot for your help.


[jQuery] Re: (autocomplete) Is it possible to cache the empty results ?

2009-09-03 Thread mathieuuu

I found it :
in fact I had to replace if (data  data.length) by if (data)
and now it's working with empty results.

Shouldn't it be the appopriate behaviour ?


On Sep 3, 2:47 pm, mathieuuu mathie...@gmail.com wrote:
 Does somebody has any idea ?

 On 31 août, 15:28, mathieuuu mathie...@gmail.com wrote:

  Hi,

  Thanks for your answer rupak but I tried your fix and it did not give
  the expected result.
  On the contrary, now I think that the plug in is no longer using
  cache, even for non-empty results...

  On 31 août, 13:58, rupak mandal rupakn...@gmail.com wrote:

   Hi ,
   you have to make a little changes in autocomplete.js

   Search for *if (data  data.length*) condition which is inside 
   request
   function. Add this code before the *if * condition

   if(data)
       data.length=0;

   Thanks
   Rupak

   On Mon, Aug 31, 2009 at 3:36 PM, mathieuuu mathie...@gmail.com wrote:

Hello,

I am currently using the jquery autocomplete ($Id:
jquery.autocomplete.js 5785 2008-07-12 10:37:33Z) with remote data.

Obviously I did not disabled the cache and matchSubset option (all
matches of foot are a subset of all matches for foo), which
reduces the number of queries made to the server.

This is working well except in one case : if foo returns an empty
result set, continue by typing foot will still generate another
query to the server ...
From my point of view this shouldn't be useful (if foo doesn't
return results, foot won't either) and I am looking for a way to
have the same cache usage with empty result as with not-empty
results.

Does anyone have an idea of how this could be done or knows the reason
why there is this difference of behaviour ?

Thank you a lot for your help.


[jQuery] Re: (autocomplete) Is it possible to cache the empty results ?

2009-08-31 Thread rupak mandal
Hi ,
you have to make a little changes in autocomplete.js

Search for *if (data  data.length*) condition which is inside request
function. Add this code before the *if * condition

if(data)
data.length=0;

Thanks
Rupak


On Mon, Aug 31, 2009 at 3:36 PM, mathieuuu mathie...@gmail.com wrote:


 Hello,

 I am currently using the jquery autocomplete ($Id:
 jquery.autocomplete.js 5785 2008-07-12 10:37:33Z) with remote data.

 Obviously I did not disabled the cache and matchSubset option (all
 matches of foot are a subset of all matches for foo), which
 reduces the number of queries made to the server.

 This is working well except in one case : if foo returns an empty
 result set, continue by typing foot will still generate another
 query to the server ...
 From my point of view this shouldn't be useful (if foo doesn't
 return results, foot won't either) and I am looking for a way to
 have the same cache usage with empty result as with not-empty
 results.

 Does anyone have an idea of how this could be done or knows the reason
 why there is this difference of behaviour ?

 Thank you a lot for your help.



[jQuery] Re: (autocomplete) Is it possible to cache the empty results ?

2009-08-31 Thread mathieuuu

Hi,

Thanks for your answer rupak but I tried your fix and it did not give
the expected result.
On the contrary, now I think that the plug in is no longer using
cache, even for non-empty results...

On 31 août, 13:58, rupak mandal rupakn...@gmail.com wrote:
 Hi ,
 you have to make a little changes in autocomplete.js

 Search for *if (data  data.length*) condition which is inside request
 function. Add this code before the *if * condition

 if(data)
     data.length=0;

 Thanks
 Rupak

 On Mon, Aug 31, 2009 at 3:36 PM, mathieuuu mathie...@gmail.com wrote:

  Hello,

  I am currently using the jquery autocomplete ($Id:
  jquery.autocomplete.js 5785 2008-07-12 10:37:33Z) with remote data.

  Obviously I did not disabled the cache and matchSubset option (all
  matches of foot are a subset of all matches for foo), which
  reduces the number of queries made to the server.

  This is working well except in one case : if foo returns an empty
  result set, continue by typing foot will still generate another
  query to the server ...
  From my point of view this shouldn't be useful (if foo doesn't
  return results, foot won't either) and I am looking for a way to
  have the same cache usage with empty result as with not-empty
  results.

  Does anyone have an idea of how this could be done or knows the reason
  why there is this difference of behaviour ?

  Thank you a lot for your help.


[jQuery] Re: [autocomplete] how to clear hidden key field when user changes text value?

2009-08-26 Thread Dac

Thanks Jörn!

It took me a minute to realize that .autocomplete should reference
my text input control (and not an autocomplete generated object), and
that .search() is an autocomplete function. But otherwise, it did the
trick.

Darren


On Aug 20, 2:39 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
wrote:
 You could try this, similar to what the plugin does for the mustMatch option:

 $(.autocomplete).blur(function() {
  $(this).search(function(result) {
    if (!result) {
      // no match found, do something, eg. clearing other fields
    }
  });

 });

 Jörn

 On Thu, Aug 13, 2009 at 5:25 PM, Billybilly.swee...@gmail.com wrote:

  Hi all,
  I'm usingautocompleteplugin, when the user types something the
  backend responds value and key information (for instance:

  John|76178
  Mike|87252
  Peter|87511

  Using .result I'm setting the key in a hidden field in my form.

  $('#autocompleteTextboxId').result(function(event, data, formatted) {
         if (data)
                 $('#autocompleteHiddenValueId').val(data[1]);
  });

  But what if the user changes his mind and after choosing John types
  something else in the textbox (without actually chosing a new option
  from theautocompleteoptions) or even deletes the whole text? As
  things are now, the data previously set in the hidden field remains
  there. So the user might post the form thinking that his selection is
  blank, but the system actually thinks that he selected 76178.

  Is there a way to clear the hidden field when the user types
  something?

  I tried by setting some action to focus so that whenever the user
  focuses on the textbox the hidden value is cleared but it seems that
  after the user chooses a value in theautocompleteoptions, the plugin
  sets focus to the text field (hence making this action execute, thus
  clearing the hidden value everytime).

  $('#autocompleteTextboxId').focus(function() {
         $('#autocompleteHiddenValueId').val('');
  });

  It would be cool if we had something like .textChanged (similar to
  .result above) where we can do some action when the user changes the
  text on the field.

  Maybe some of the JS wizards here can suggest something.

  Thanks.


[jQuery] Re: [autocomplete] how to clear hidden key field when user changes text value?

2009-08-26 Thread jero

Thanks! I was looking for this too.

On Aug 20, 1:39 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
wrote:
 You could try this, similar to what the plugin does for the mustMatch option:

 $(.autocomplete).blur(function() {
  $(this).search(function(result) {
    if (!result) {
      // no match found, do something, eg. clearing other fields
    }
  });

 });

 Jörn

 On Thu, Aug 13, 2009 at 5:25 PM, Billybilly.swee...@gmail.com wrote:

  Hi all,
  I'm usingautocompleteplugin, when the user types something the
  backend responds value and key information (for instance:

  John|76178
  Mike|87252
  Peter|87511

  Using .result I'm setting the key in a hidden field in my form.

  $('#autocompleteTextboxId').result(function(event, data, formatted) {
         if (data)
                 $('#autocompleteHiddenValueId').val(data[1]);
  });

  But what if the user changes his mind and after choosing John types
  something else in the textbox (without actually chosing a new option
  from theautocompleteoptions) or even deletes the whole text? As
  things are now, the data previously set in the hidden field remains
  there. So the user might post the form thinking that his selection is
  blank, but the system actually thinks that he selected 76178.

  Is there a way to clear the hidden field when the user types
  something?

  I tried by setting some action to focus so that whenever the user
  focuses on the textbox the hidden value is cleared but it seems that
  after the user chooses a value in theautocompleteoptions, the plugin
  sets focus to the text field (hence making this action execute, thus
  clearing the hidden value everytime).

  $('#autocompleteTextboxId').focus(function() {
         $('#autocompleteHiddenValueId').val('');
  });

  It would be cool if we had something like .textChanged (similar to
  .result above) where we can do some action when the user changes the
  text on the field.

  Maybe some of the JS wizards here can suggest something.

  Thanks.


[jQuery] Re: [autocomplete]

2009-08-25 Thread Jörn Zaefferer

What is a virtual keyboard?

Jörn

On Tue, Aug 25, 2009 at 2:43 PM, Mahmoud
wagdyeng.mahmoud.wa...@gmail.com wrote:

 we need to add a virtual keyboard to the same textbox which uses yours
 autocomplete plugin.
 is this applicable with your autocomplete plugin



[jQuery] Re: [autocomplete] how to query for words with special (UTF-8 encoded) characters?

2009-08-24 Thread Adriano Varoli Piazza

On 7 ago, 06:06, Christer Bygdestam christer.bygdes...@gmail.com
wrote:
 Hi,

 I'm trying to get Joerns awesomeautocomplete-plugin to work with
 UTF-8 but I've had no luck in making it work. Has anyone managed to
 query the backend using UTF-8 encodendcharacters?

 Right now I'm trying my best to decode the incoming string ie
 q=Östman but nothing happens? Do I need to encode the returned
 string as well?

 Any thoughts are greatly appreciated!

 Christer

I'd like to bump this up. I'm trying to implement a dynamic form, and
I need to query for words containing (in this particular case) ñ.

Example:
I want to query for the city 'Añatuya'.
- typing in 'aña' doesn't find it.
- typing in 'ana' displays the word, but without the 'aña' sequence
highlighted. (other returned strings that do contain 'ana' are
properly highlighted).

- firebug tells me the query string sent is
http://localhost/alabern/autocomplete/prov.php?q=a%C3%B1alimit=1000timestamp=1251146094589

Any solutions or pointers? I'm not really javascript-savvy enough to
actually start picking the plugin apart by myself.

--
Saludos
Adriano


[jQuery] Re: [autocomplete] how to clear hidden key field when user changes text value?

2009-08-20 Thread Jörn Zaefferer

You could try this, similar to what the plugin does for the mustMatch option:

$(.autocomplete).blur(function() {
 $(this).search(function(result) {
   if (!result) {
 // no match found, do something, eg. clearing other fields
   }
 });
});

Jörn

On Thu, Aug 13, 2009 at 5:25 PM, Billybilly.swee...@gmail.com wrote:

 Hi all,
 I'm using autocomplete plugin, when the user types something the
 backend responds value and key information (for instance:

 John|76178
 Mike|87252
 Peter|87511


 Using .result I'm setting the key in a hidden field in my form.

 $('#autocompleteTextboxId').result(function(event, data, formatted) {
        if (data)
                $('#autocompleteHiddenValueId').val(data[1]);
 });

 But what if the user changes his mind and after choosing John types
 something else in the textbox (without actually chosing a new option
 from the autocomplete options) or even deletes the whole text? As
 things are now, the data previously set in the hidden field remains
 there. So the user might post the form thinking that his selection is
 blank, but the system actually thinks that he selected 76178.

 Is there a way to clear the hidden field when the user types
 something?

 I tried by setting some action to focus so that whenever the user
 focuses on the textbox the hidden value is cleared but it seems that
 after the user chooses a value in the autocomplete options, the plugin
 sets focus to the text field (hence making this action execute, thus
 clearing the hidden value everytime).

 $('#autocompleteTextboxId').focus(function() {
        $('#autocompleteHiddenValueId').val('');
 });

 It would be cool if we had something like .textChanged (similar to
 .result above) where we can do some action when the user changes the
 text on the field.

 Maybe some of the JS wizards here can suggest something.

 Thanks.



[jQuery] Re: [autocomplete] trigger event if user rejects all autocomplete otions

2009-08-20 Thread Jörn Zaefferer

You could try this, similar to what the plugin does for the mustMatch option:

$(.autocomplete).blur(function() {
  $(this).search(function(result) {
if (!result) {
  // no match found, do something, eg. clearing other fields
}
  });
});

Jörn

On Tue, Aug 11, 2009 at 8:30 PM, Ashash.sea...@gmail.com wrote:

 Does anyone have a library or patch to call a handler if a user leaves
 an autocomplete field without choosing one of the autocomplete options
 - i.e. they've entered free text.

 I'm working with an app that populates multiple fields from a single
 auto-complete value, and our latest requirement is to clear out a
 bunch of fields if the user's entered something manually - rejecting
 autocomplete suggestions.

 My initial attempts at hooking into onkeyfoo and onblur haven't lead
 anywhere productive, and I'm hoping someone else has managed to
 overcome the gnarly event and timing dependencies involved with
 onkeyfoo and blur being used for standard autocomplete behaviour.

 Note: I'm working with http://plugins.jquery.com/project/autocompletex
 - but I'm happy to switch libraries and/or port functionality and
 patches over from another solution.



[jQuery] Re: [autocomplete] Dynamic textboxs

2009-08-06 Thread Jake McGraw

Every time you insert a new text field to the DOM, you have to call
autocomplete().

On Wed, Jul 22, 2009 at 10:03 AM, escribatiago.garrochi...@gmail.com wrote:

 I can't put autocomplete working with dynamic textboxs. I have a
 javascript function to add dynamic textboxs, but when i attach the
 autocomplete function to the dynamic textboxs, it doenst work.

 Some work that might help this issue:

 // Javascript function that adds dynamicly textboxs

 var initial_count = new Array();
 var rows_limit = 5; // Set to 0 to disable limitation

 function addRow(table_id)
 {
        var tbl = document.getElementById(table_id);
        // counting rows in table
        var rows_count = tbl.rows.length;
        if (initial_count[table_id] == undefined)
        {
                // if it is first adding in this table setting initial rows 
 count
                initial_count[table_id] = rows_count;
        }
        // determining real count of added fields
        var tFielsNum =  rows_count - initial_count[table_id];
        if (rows_limit!=0  tFielsNum = rows_limit) return false;
        var input = 'input class=text_area type=text name=author[]
 id=bla size=70 maxlength=250/';
        var remove= 'input type=button value=- onclick=removeRow
 (\''+table_id+'\',this.parentNode.parentNode)/';

        try
        {
                var newRow = tbl.insertRow(rows_count);
                var newCell = newRow.insertCell(0);
                newCell.innerHTML = input;
                var newCell = newRow.insertCell(1);
                newCell.innerHTML = remove;
        }
        catch (ex) {
                //if exception occurs
                alert(ex);
        }
 }

 // Button that adds textboxs dynamicly
 input type=button name=Button value=+ onClick=addRow
 ('authorsTable') /

 // Jquery autocomplete function call

 $(document).ready(function()
 {
        $(#bla).autocomplete(cities);
 });

 NOTICE: I already have this working with fixed textboxs, the only
 problem is with dynamicly added textboxs. Thanks



[jQuery] Re: autocomplete

2009-07-28 Thread @@
yes we can :p

mustMatchBoolean http://docs.jquery.com/Types#Boolean*Default:* false If
set to true, the autocompleter will only allow results that are presented by
the backend. Note that illegal values result in an empty input box.

On Tue, Jul 28, 2009 at 7:14 AM, sush susmitha.ma...@gmail.com wrote:


 Hi,
  I am using the autocomplete on local client array , and want know how
 can i allow user to key in the text if autotext could not find any
 results.
 your help is greatly appreciated.

 Thanks,
 sush



  1   2   3   4   5   6   7   >