469,358 Members | 1,632 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,358 developers. It's quick & easy.

how to manipulate the selection data


if sel represents a select object, then

var length = sel.length;
var aValue = sel.option[i];
var aIndex = sel.selectedIndex;

I'm wondering what's idea to manipulate this sel, like

var backup = clone(sel);

insert(sel.option[i], value,text);

Thanks lots.

Jul 23 '05 #1
3 1211

You have to be much more specific on what you need, roughly I'd guess
you're populating a Select options from another as source, which is easy
to do, but you have to specify what you need.
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Jul 23 '05 #2

it's like

insert another item in the selection-list, remove an item from the
selection-list, make a clone/copy for that selection-object in order to
recover the changed select object.

for ex: if

select name="sel" SIZE ="5" style="width:200px;" >
<option value="0"> &lt;ALL&gt
<option value="1" >a
<option value="2" >b
<option value="3" >c
<option value="6" >f

then I'd like to insert 2 more, as

<option value="4" >d
<option value="5" >e

or want to remove the 2rd item, so it doesn't have

<option value="2" >b

or at the begining have a clone object, then after changing sel, it can
be recovered.


Jul 23 '05 #3
Can any one share an example?


Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by damjanu | last post: by
reply views Thread by garethrichardadams | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.