JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 5th, 2001, 02:44 PM
mrhenriksson mrhenriksson is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Posts: 2 mrhenriksson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question javascript and multiple select

Hi,

I have several <select name="name1[]" multiple> that each contains several options.
What I want is to see if a sertain option is selected. The problem is that I don't know how to do that if the name of the select have [] at the end.

I've managed to do this if I don't add [] at the end of the name, but then I can't send all the values if I select several, becouse it only sends the last selected value and treats it as a string, not an array:

function check_write(value) {
if (value.options[1].selected == 0) {
theform.manage.options[1].selected = 1;
}
}

....

<select name="manage" onChange="check_write(this);">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>



What I need to know is how I can do a script that works as the one above, but treats the select (manage) as an array instead of a string.

Thanks,
Martin Henriksson

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > javascript and multiple select

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap