Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2004
    Location
    Reading, Berkshire
    Posts
    2,260
    Tokens
    12,202
    Habbo
    :Jin:

    Latest Awards:

    Default Jquery/ajax database lookup and form autocomplete

    I have been toying around with the best way of doing this:

    I basically have a very extensive form:

    The form breaks up into 2 parts,

    Vehicles
    &
    Log

    Each part relates to a separate table.

    Now I have two fields in the vehicles section of my form "Reg Number:" & "Hire ID".

    if one of these two fields has a string of X number of characters in it I want it to lookup this strings in the database and return values which can be assigned to a hidden field as well as auto-completing the rest of the vehicles form based upon what information is in the database otherwise the form can be completed as normal and the entry be submitted to the database.

    any ideas or any links?
    Last edited by Jin; 25-02-2011 at 01:51 PM.


  2. #2
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    Like this?

    http://docs.jquery.com/Plugins/autocomplete#Example

    Are you wanting the help more specifically with the javascript side or the PHP side? On your AJAX call to the PHP, search the database and then return everything as an array with json_encode, very easy to combine with Javascript. Then populate the form.

Posting Permissions

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