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 3 of 3

Thread: AJAX Search Box

  1. #1
    Regular Coder
    Join Date
    Mar 2006
    Posts
    459
    Thanks
    3
    Thanked 0 Times in 0 Posts

    AJAX Search Box

    Hi all... I have seen it a million times but can't seem to find out how to do it, I am a total total noob to AJAX. When a new customer signs up on my website, they can pick a store which is closest to them. If they don't know which store that is, I want to have a textfield, which when they input their zip code into the name of the store associated with that zip code is written underneath the search box... I don't want them to have to click search just type in the zip code on the on the final number the result displays... I've set up a table in my databases which is called 'tblstorezip' and next to each zip is the appropriate store... If anyone can help of point me in the right direction would be much appreciated!

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    well you would have to add onkeypress to the textbox and watch the length of the value [probably want to check for numeric too]

    That you can fire off an Ajax request. Here is the basic article on Ajax: http://developer.apple.com/internet/...mlhttpreq.html

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    Regular Coder
    Join Date
    Jun 2007
    Location
    Los Angeles
    Posts
    545
    Thanks
    81
    Thanked 5 Times in 5 Posts
    Yep, that's the process - use JS onkeyprocess and count for a valid zip length - and don't forget to filter keys so you only get digits otherwise you might end up going to your DB with junk characters!
    RalphF
    Business Text Messaging Services
    https://www.MobileTextingService.com


  •  

    Posting Permissions

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