Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: Form validation

  1. #1
    Sab
    Sab is offline
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Form validation

    Hi

    I am new to javascript so if i ask a non-javascript question please excuse me for that.

    Can someone give me example on how to create drop down list
    like travelsupermarket.com. When searching for flight destinations, upon entering the first three letters you get an auto list to select the most appropriate.

    Basically I need something similar to make sure that the user enters
    correct account number (retrieved from mysql) on the form.

    I have used php/mysql.

    I hope i have made sense.

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,074
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Editable Type-ahead Combo script in my sig might be the one you're looking for.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #3
    Sab
    Sab is offline
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks for the reply but its not what im looking for. if you go to travelsupermarket.com
    and type first few letters of destination in 'flying to' textbox you will know what i mean. my try typing just 'dub' and you will get the list below to choose from.
    Last edited by masmedia; 01-21-2014 at 03:51 PM. Reason: link removal request

  • #4
    New to the CF scene
    Join Date
    Mar 2005
    Location
    Toronto
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Having looked at the page source of that site I have to say that to accomplish such a drop-down list is no small feat. The developers of the site use Ajax technology and a continuosly running function that get called on the focus event to bring the search results from the server. Not for the faint of heart. I mean it will take a lot of work.

  • #5
    Sab
    Sab is offline
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank for the reply. Is there are a way to do something similar using javascript. Basically I want to make sure that the user only enter account numbers exists in mysql database. Any highlight on alternative solution(s) would be greatly appreciated.

    Thanks again

  • #6
    New to the CF scene
    Join Date
    Mar 2005
    Location
    Toronto
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    An alternative solution would be obtain account numbers from the database first and create an array of account numbers in client-side JavaScript when the page is first loaded. Then you could check user-typed numbers against that array without having to go the server. Naturally, this exposes account numbers to anyone willing to view the page source so it might not be suitable.
    Ajax is the best solution in this situation.


  •  

    Posting Permissions

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