SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    May 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile multiple entries into a textbox with (,) seperation

    Hi,
    I m new to ajax. I have to implemented the ajax autocomplete.When I press any alphabet say suppose "a", I should get all names starting with "a" say arman,anoop,anju etc one below other. now when i select one of them say 'arman' the text box will should display "arman,". Now when I press "a" again then it should show "anoop" & "anju" one below the other.As i want to enter multiple values with comma seperated.And when I select any one of this, it should append the the value previously present in text box(i.e it should append the value "arman").

    Please reply to this...
    I would be really thankful to u all..
    Thanks.

  2. #2
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    What do you have so far? You could use the same PHP script to fetch the names for all the requests, although the bulk of the work needs be via JavaScript.

    Maybe post in there?

    If you need help with the PHP side of it, just shout.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  3. #3
    SitePoint Member
    Join Date
    May 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile

    Actually i dont have any code with me, but some how I manages to do the ajax suggest sought of thing.
    When we press a key it will display all the matching words in a div just like we have in google toolbar but I want something like what we see in google suggest with multiple values for example when we send emails to multiple persons in gmail or yahoomail using php-mysql-ajax.

  4. #4
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    googling ajax autocomplete php finds many tutorials, this is the second one down.

  5. #5
    SitePoint Member
    Join Date
    May 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you for your valuable suggestion but I have already got this thing.What I need is something similar to this I mean in the link you provided a user can select only one value at a time but what if he want to enter more than 1 value with a (,) seperator.I think you got me. I mean to say that when we forward or send mails to more than one person after inserting the address and press (,) again the ajax will display the list of email addresses matching the letter after (,).

    I need something similar to that functionality

  6. #6
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Welcome to the forums.

    Think about it logically. If it wasn't a computer doing the lookup but it was infact you, how would you do it?

    First of all, get rid of everything up until the last comma. This will isolate the current value. Trim the spaces around it and send that shortened string to PHP with AJAX. Put the returned values in the box as you normally would. When they click a value, remove the text AFTER the final comma, then put the clicked value onto that.
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •