Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-10-2011, 12:34 PM   PM User | #1
izecul
New Coder

 
Join Date: Jan 2011
Posts: 10
Thanks: 4
Thanked 0 Times in 0 Posts
izecul is an unknown quantity at this point
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.
izecul is offline   Reply With Quote
Old 01-10-2011, 01:06 PM   PM User | #2
Arnaud
Regular Coder

 
Join Date: Jan 2008
Location: Geneva, Switzerland
Posts: 413
Thanks: 12
Thanked 29 Times in 29 Posts
Arnaud is on a distinguished road
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.
Arnaud is offline   Reply With Quote
Old 01-10-2011, 05:14 PM   PM User | #3
izecul
New Coder

 
Join Date: Jan 2011
Posts: 10
Thanks: 4
Thanked 0 Times in 0 Posts
izecul is an unknown quantity at this point
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?
izecul is offline   Reply With Quote
Old 01-10-2011, 07:33 PM   PM User | #4
Arnaud
Regular Coder

 
Join Date: Jan 2008
Location: Geneva, Switzerland
Posts: 413
Thanks: 12
Thanked 29 Times in 29 Posts
Arnaud is on a distinguished road
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.
Arnaud is offline   Reply With Quote
Old 01-10-2011, 08:11 PM   PM User | #5
izecul
New Coder

 
Join Date: Jan 2011
Posts: 10
Thanks: 4
Thanked 0 Times in 0 Posts
izecul is an unknown quantity at this point
An autocomplete field... whose suggestions are derived as an AJAX response
izecul is offline   Reply With Quote
Reply

Bookmarks

Tags
ajax, css, dropdown, formatting

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:21 AM.


Advertisement
Log in to turn off these ads.