Hey guys, i want to know one more thing in autocomplete. I managed to get it
working. Now wat i was thnkng is, how can i get multiple autocomplete in a
single input field comma seperated.

I mean suppose i type "ca" and get camera and now i place a "," and type
"ha" than i need it should show me "handle". how can i achieve ds.

The js i am using is this

////file:app/webroot/js/application.js
$(document).ready(function(){
// Caching the movieName textbox:
var username = $('#username');

// Defining a placeholder text:
username.defaultText('Search for people');

// Using jQuery UI's autocomplete widget:
username.autocomplete({
minLength    : 1,
multiple: true,
multipleSeparator: " ",
source        : 'search'
});

});

// A custom jQuery method for placeholder text:

$.fn.defaultText = function(value){

var element = this.eq(0);
element.data('defaultText',value);

element.focus(function(){
if(element.val() == value){
element.val('').removeClass('defaultText');
}
}).blur(function(){
if(element.val() == '' || element.val() == value){
element.addClass('defaultText').val(value);
}
});

return element.blur();
}


On Tue, Apr 5, 2011 at 4:36 AM, BenJsno <[email protected]> wrote:

> hi,
> You have to import jQuery and jQuery UI
> I use autocomplete too and it works fine.
> check this tutorial :
> http://blogfreakz.com/cakephp/cakephp-jquery-autocomplete-tutorial/
>
>
> On 4 avr, 17:12, Shashank <[email protected]> wrote:
> > Hey guys, can anyone plz suggest me what can be done for this??
> >
> > On Mon, Apr 4, 2011 at 8:31 PM, Shashank <[email protected]>
> wrote:
> > > Hi Guys,
> > > I am trying to use autocomplete in my cakephp, but getting an error
> > > like ds:
> >
> > > $("#UserUsername").autocomplete is not a function
> > > [Break on this error] $('#UserUsername').autocomplete('/events/
> > > addevent', {});
> >
> > > i have no idea why i am getting this error??.
> >
> > > Can anyone suggest me anything??
> >
> > --
> > Shashank Singh
> > B.E.(Computer Science)
> > Software Developer
> > +91-9711882054
> > +91-9560545085
> > Skype id: shashank.singh87
> > Email: [email protected]
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> [email protected] For more options, visit this group
> at http://groups.google.com/group/cake-php
>



-- 
Shashank Singh
B.E.(Computer Science)
Software Developer
+91-9711882054
+91-9560545085
Skype id: shashank.singh87
Email: [email protected]

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to