You are not logged in.

#1 2008-05-13 19:47:29

madeye
Member
From: Denmark
Registered: 2006-07-19
Posts: 331
Website

javascript form question

I have run into a little challenge. I would have searched for it on google, but I have no idea what it's called.
On to the describtion

I want to have two fields on a web page. I click a value in the left field, and press a button to add it to the right field. I can add more values this way.
This will all be a part of a form that I need to send to another page.

Can anyone tell me what to search for? Maybe even some examples?
I looked at some javascript sites, but could not (without knowing what to search for) really find anything useful.


MadEye | Registered Linux user #167944 since 2000-02-28 | Homepage

Offline

#2 2008-05-13 21:25:10

gnud
Member
Registered: 2005-11-27
Posts: 182

Re: javascript form question

The simplest solution is two html select elements (with the multiple attribute set to true, and size set appropriately). Add some javascript to move items between them.

Offline

#3 2008-05-14 12:47:05

mrunion
Member
From: Jonesborough, TN
Registered: 2007-01-26
Posts: 1,938
Website

Re: javascript form question

You need two lists (which is a <SELECT> HTML tag) and some javacript to move between the lists.  Start by searching for <SELECT> to get the info and DOM model on it, then search the javascript to move items between lists.

(I don't have tome to write an example right now or I would.  Sorry.)


Matt

"It is very difficult to educate the educated."

Offline

#4 2008-05-14 17:35:40

madeye
Member
From: Denmark
Registered: 2006-07-19
Posts: 331
Website

Re: javascript form question

Thanks for the replies.
I will look into the <SELECT> tag and see if I can get it to work. I am not really good at javascript as I mostly do XHTML/PHP/MYSQL, but I guess it will get easier with practice smile

EDIT:
OK, I think I found the solution to my challenge. (Remember. We have challenges, not problems wink )

Here is the link to the solution if anyone should need it.
http://www.mredkj.com/tutorials/tutorial007.html

I will try to use the PHP version further down on the page, as that fits in with the code I already have.

Last edited by madeye (2008-05-14 19:06:37)


MadEye | Registered Linux user #167944 since 2000-02-28 | Homepage

Offline

Board footer

Powered by FluxBB