change the option of all other select menus in page with same id
<p>I'm new to javascript and need help to figure this one.</p>

<p>I have three menus where you select and option and for each menu you select it displays a row of data. In each row (i.e. 3 row for 3 selections) another select menu is available for you to pick a provider for that product. I created another select that you select a default provider and onchange the other menus in the rows change. The problem I have is that they all have the same id because when you pick an option a function gets called. I tried to loop through all select and from those selects with id=x change selected option but only works for 1st select found with that id</p>

<pre><code>echo" function pickprovider($name, $idname){ \n";

echo" &lt;select name='$name' id='idname'&gt; \n";
echo" &lt;option&gt;1stprovider &lt;/option&gt; \n";
echo"  &lt;option&gt;2ndprovider &lt;/option&gt;\n";
echo " &lt;/select&gt;\n";
echo" }\n";

echo" function defaultprovider($name, $idname) {\n";
echo" &lt;select name='$name' id='idname' onchange='changeDflt(this);'&gt; \n";
echo " &lt;option&gt;1stprovider &lt;/option&gt; \n";
echo " &lt;option&gt;2ndprovider &lt;/option&gt; \n";
echo "&lt;/select&gt;\n";
echo" }\n";

 echo "&lt;script type='text/javascript'&gt;\n";
 echo "function ChangeDflt(list) { \n";
 echo "var x = list.options[list.selectedIndex].text;\n";
 echo "var allSelects = document.getElementsByTagName('select');\n";
 echo "for (var i = 0; i &lt; allSelects.length; i++) { \n";
 ....
 change selected options for selects 
 echo "}\n";
 echo "}\n";
 echo "&lt;/script&lt;\n";
</code></pre>

<p>I do not know how to change the function to make a unique id everytime the function is called. ....Can I use "div" tag when I get all the select elements in page?</p>
