Monday, April 4, 2011

Re: Auto complete in Cakephp

I tried again with the Ajax Helper autocomplete. But now i am getting an error

ajax/autoComplete?q=s     NOT FOUND

i have the ajax helper and javascript helper in my app/views/helpers

And i have include jquery.autocomplete.js in my view. What i doing wrong. I have also included the ajax helper in my controller. I am really not getting what i am doing wrong in here.

On Tue, Apr 5, 2011 at 10:40 AM, Shashank <cooldude17202000@gmail.com> wrote:
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 <benchere@yahoo.fr> 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 <cooldude17202...@gmail.com> wrote:
> Hey guys, can anyone plz suggest me what can be done for this??
>
> On Mon, Apr 4, 2011 at 8:31 PM, Shashank <cooldude17202...@gmail.com> 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: shashank.si...@sourcefuse.com

--
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
cake-php+unsubscribe@googlegroups.com 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: shashank.singh@sourcefuse.com




--
Shashank Singh
B.E.(Computer Science)
Software Developer
+91-9711882054
+91-9560545085
Skype id: shashank.singh87
Email: shashank.singh@sourcefuse.com

--
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
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: