Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Submit button to select all items in a SELECT menu

Reply
Thread Tools

Submit button to select all items in a SELECT menu

 
 
Gumtree
Guest
Posts: n/a
 
      11-09-2004
Hi folks,

The user interface I'm trying to impliment looks a bit like
this:

Not Chosen Chosen
.------------. .------------.
|Item 1 | -> |Item 3 |
|Item 2 | <- |Item 4 |
|Item 6 | >> |Item 5 |
| | << |Item 7 |
`------------' `------------'

[Submit button]

All works so far, however, items not selected in the right
hand SELECT menu don't get passed as values when submitted.
Is there a recommended way to automatically select all items
in a SELECT menu on the click of the Submit button?

Any bits of code or URL suggestions most appreciated. Thanks.

 
Reply With Quote
 
 
 
 
Zifud
Guest
Posts: n/a
 
      11-09-2004
Gumtree wrote:
> Hi folks,

[...]
> All works so far, however, items not selected in the right


All what?

>
> Any bits of code or URL suggestions most appreciated. Thanks.
>


Perhaps if you post a concise example of what you have done you will
get some help. I can think of at least 4 different ways of
implementing what you describe, all of which may be totally different
to how you have done it.

Zif.
 
Reply With Quote
 
 
 
 
Gumtree
Guest
Posts: n/a
 
      11-10-2004
Zifud <(E-Mail Removed)> wrote:
> Gumtree wrote:
>> Hi folks,

> [...]


] The user interface I'm trying to impliment looks a bit like
] this:
]
] Not Chosen Chosen
] .------------. .------------.
] |Item 1 | -> |Item 3 |
] |Item 2 | <- |Item 4 |
] |Item 6 | >> |Item 5 |
] | | << |Item 7 |
] `------------' `------------'
]
] [Submit button]

>> All works so far, however, items not selected in the right

>
> All what?


The interface: ie, the JS that covers moving items from List 1
to List 2 and back -- individually and groups.

>> Any bits of code or URL suggestions most appreciated. Thanks.

>
> Perhaps if you post a concise example of what you have done you will
> get some help.


There was hardly any point rabbitting on about the code that
works, considering it was irrelevant to the problem. The
question was:

] items not selected in the right hand SELECT menu don't get passed
] as values when submitted. Is there a recommended way to automatically
] select all items in a SELECT menu on the click of the Submit button?

(God only knows why you snipped the question in your reply...)

> I can think of at least 4 different ways of
> implementing what you describe, all of which may be totally different
> to how you have done it.


Not to worry. I ended up redesigning the interface so as to not
need Javascript.

The Javascript would have been prettier UI, but, the replacement
is functional. Quite a relief though not to have to worry about
the idiocies of client browser incompatibilities, the effects of
JS not being enabled on browsers, etc.

All the best.

 
Reply With Quote
 
Matt Kruse
Guest
Posts: n/a
 
      11-10-2004
Gumtree wrote:
> The user interface I'm trying to impliment looks a bit like
> this:
> Not Chosen Chosen
> .------------. .------------.
> |Item 1 | -> |Item 3 |
> |Item 2 | <- |Item 4 |
> |Item 6 | >> |Item 5 |
> | | << |Item 7 |
> `------------' `------------'


I have a lib which implements this exact functionality. It stores values in
hidden fields to keep track of which items were added or removed from each
list, plus all the contents of each list. I prefer this method to selecting
all options in the target list before submitting.

http://www.javascripttoolbox.com/optiontransfer/

> Is there a recommended way to automatically select all items
> in a SELECT menu on the click of the Submit button?


If you did want to go this route, you could use selectAllOptions() in my
functions at
http://www.javascripttoolbox.com/selectbox/

--
Matt Kruse
http://www.JavascriptToolbox.com


 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing Menu Items and Child Menu Items Larry Bud ASP .Net 13 01-07-2008 02:12 PM
Iterating through all the menu/child items in a menu control Bryan ASP .Net 1 03-01-2006 09:38 AM
Dumb question about using a <SELECT> menu to change the state of<SELECT> menu... Bonge Boo! Javascript 5 04-25-2005 10:49 PM
implement "select all" button to select all checkboxes Matt ASP General 2 01-11-2004 01:08 PM
pmw MenuBar: delete all menu items of a menu Tina Li Python 0 09-18-2003 09:57 PM



Advertisments