Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can i include selected index of one drop down

Status
Not open for further replies.

andycape

Programmer
Aug 22, 2003
177
ZA
in the index of another ?

I have 2 drop downs, i want to include the value of the 2nd drop down in the index of the first :

1st drop down :

<select style=&quot;width:100&quot; name=&quot;ForTable&quot; onchange=&quot;parent.Main1.location.href=this.options[this.selectedIndex].value&quot;>
<option value=&quot;ManageData.asp?ForTable=Contacts&quot;>a Contact</option>
<option value=&quot;ManageData.asp?ForTable=Phones&quot;>a Phone</option>
<option value=&quot;ManageData.asp?ForTable=Address&quot;>an Address</option>
<option value=&quot;ManageData.asp?ForTable=Notes&quot; Selected >a Note</option>
<option value=&quot;ManageData.asp?ForTable=Misc&quot;>Misc Info</option>
</select>

2nd drop down :

<select style=&quot;width:200&quot; size=&quot;5&quot; name=&quot;CompanyID&quot;>
<option value=&quot;1&quot;>1</option>
<option value=&quot;2&quot;>2</option>
<option value=&quot;3&quot;>3</option>
</select>

so i want to be able to include the value of the selected option in the 2nd drop down , into the value of the first.

so i can get something like : ManageData.asp?ForTable=Notes&CompanyID=2

for the value of the 1st drop down.


I tried this but its not working :

ManageData.asp?ForTable=Notes&CompanyID=CompanyID.options[this.selectedIndex].value

thanx.
 
It's an odd way of doing things, but have you tried this....

<select style=&quot;width:100&quot; name=&quot;ForTable&quot; onchange=&quot;parent.Main1.location.href=this.options[this.selectedIndex].value + '&CompandID=' + document.forms[0].CompanyID.selectedIndex&quot;>


Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

fart.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top