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 5 of 5
  1. #1
    New Coder
    Join Date
    Jan 2011
    Posts
    10
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Container/Dropdown for an AJAX Query

    How do I make the dropdowns for an AJAX input field? I have the Javascript and PHP part working, but I have no clue how to format a container for the AJAX results.

  • #2
    Regular Coder
    Join Date
    Jan 2008
    Location
    Geneva, Switzerland
    Posts
    413
    Thanks
    12
    Thanked 29 Times in 29 Posts
    Posting your working code might help. I don't even understand what you're talking about. Are you trying to populate a dropdown-list with AJAX? Or call an ajax function from the contents of your dropdown list?
    Chuck Norris counted to infinity.
    Twice.

  • #3
    New Coder
    Join Date
    Jan 2011
    Posts
    10
    Thanks
    4
    Thanked 0 Times in 0 Posts
    I have a form where I trigger an AJAX event. I have the handler which returns a comma-separated string. I'll break up this string (for example, "arrow,arrowhead,arrears") into three separate lines
    arrow
    arrowhead
    arrears.

    And I need to put these results within a container under my input textbox, so that it looks like a dropdown.

    My question is, how do I create such a container? Is it CSS (in which case, what are the properties or attributes) or a Javascript code?

  • #4
    Regular Coder
    Join Date
    Jan 2008
    Location
    Geneva, Switzerland
    Posts
    413
    Thanks
    12
    Thanked 29 Times in 29 Posts
    Quote Originally Posted by izecul View Post
    And I need to put these results within a container under my input textbox, so that it looks like a dropdown.
    Sorry, this is the part where I get lost...

    What do you mean by container? A div ? I don't get it...
    What I understand from your post is that you want to convert a coma separated list returned by your ajax call to a "line-return" separated list?

    like... convert all comas to <br> and display that somewhere in a div?
    Chuck Norris counted to infinity.
    Twice.

  • #5
    New Coder
    Join Date
    Jan 2011
    Posts
    10
    Thanks
    4
    Thanked 0 Times in 0 Posts
    An autocomplete field... whose suggestions are derived as an AJAX response


  •  

    Tags for this Thread

    Posting Permissions

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