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 04-27-2009, 04:42 PM   PM User | #1
santhosh.v25
New to the CF scene

 
Join Date: Sep 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
santhosh.v25 is an unknown quantity at this point
Smile transfering data among 2 Combo boxes

Hi All

Could you help me out in coding JavaScript / Ajax for tranfering the data between 2 combo boxes,
let me explain this in a good way
i have 2 combo boxes assume left and right with multiple select, and 2 buttons for moving data ,one for left to right and other right to left
when i select few options from left combo and click the button all the selected should go into the right combo and at the same time those options shud be removed from left combo, i was doing this in server side but page was refreshing everytime, when i use this in clientside it was taking long time to move the data as i have 6000 options in left combo, can you help me in doing this.

thank you
santhosh.v25 is offline   Reply With Quote
Old 04-28-2009, 10:59 AM   PM User | #2
stick_branch
New Coder

 
Join Date: Oct 2008
Location: Australia
Posts: 32
Thanks: 1
Thanked 1 Time in 1 Post
stick_branch is an unknown quantity at this point
i'm assuming that you have a list of items on one side, and when the user selects them and clicks "transfer" it copies the selected items over to the right side. While technically not ajax unless you send the request off to the server, this is possible.

Give each element in the list an id, and when you click on an item, run some js to note the id that has been clicked (easiest way with so many list items). When you click transfer, pull the array from the function (best done using an object) and in that array will be all the values, this bypasses having to check each item if it has been checked. Though, i'd suggest writing the items as a js script as well, because it would create a LOT more traffic. (Maybe you should think of a way to use AJAX to get around downloading so many items?)
stick_branch is offline   Reply With Quote
Old 04-28-2009, 09:08 PM   PM User | #3
santhosh.v25
New to the CF scene

 
Join Date: Sep 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
santhosh.v25 is an unknown quantity at this point
Thumbs up

thanks for the reply, i have used js for that and it got solved,
and found new requirement about auto complet for those respective combo boxes, can you give me the suggestions how can i proceed for it

thanks in advance
santhosh.v25 is offline   Reply With Quote
Old 04-28-2009, 10:48 PM   PM User | #4
stick_branch
New Coder

 
Join Date: Oct 2008
Location: Australia
Posts: 32
Thanks: 1
Thanked 1 Time in 1 Post
stick_branch is an unknown quantity at this point
auto complete?

i'm presuming you mean something like google's suggest feature...

onkeyup="function()"

function()
{
test = input.value;
send an xmlhttp request off to the server and in the response, grab the results and put it in a relative box to the one that you're typing in. If you know how to do the ajax it should be relatively simple. If you need help with it give me a bell.
}
stick_branch is offline   Reply With Quote
Reply

Bookmarks

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 12:50 PM.


Advertisement
Log in to turn off these ads.