0

I have a page where I have 100 combo boxes.
I made this bookmarklet :

javascript:document.getElementById("hioooo").selectedIndex = 38;

It works but only for the first combo box, all the rest combobox remains unchanged although they also have the id="hioooo".
What should I do to change all the combobox selection to the 38th item ?

thanks in advance
Kazilotus

Edited by kazilotus_1

3
Contributors
7
Replies
22
Views
3 Years
Discussion Span
Last Post by kazilotus_1
0

I tried this :

javascript:document.getElementsByClassName('hioooo').selectedIndex = 38;

on this

<select name="mdocs[cat][0]" class="hioooo">
    <option value="mdocs-cat-7">1</option>
    <option value="mdocs-cat-22">2</option>
    .....
</select>

Doesn't work.
nothing changes :(

Edited by kazilotus_1

0

getElementsByClassName returns a list of elements. You need to loop through them and set the index on each element separately.

0

I'm pretty much a noob, can you please write the script how it should be ?

0

Did I read that right? A 100 select boxes? Just coz you can doesn't mean that you should.

I'm pretty much a noob, can you please write the script how it should be

You will forever stay a noob if you go down this road.

Are you sure that the 100 box solution is the right one?

0

It's not like how it looks, I have to do this with 1000 more documents.
Just check out the screenshot : https://kaylesblog.com/we.png
I'm Uploading a 100 document at a time, I have to select the category 1 by 1, which is a very big pain in the neck, a javascript script that could do this for all at once would save a lot of time.

Edited by kazilotus_1

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.