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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to set a 3rd data in SELECT dropdown box

Status
Not open for further replies.

cumap

IS-IT--Management
Jul 9, 2007
268
US
Now that this is my code:
note: a,b,c are the Array's datas
Code:
<script>
function getid2(n) {
  alert(n);
  return false;
}
</script>
<%...
aspArray = rs.getRows
%>
<select onchange='getid2('<%=aspArray(2,i)%>')>
<%for i=0 to ubound(aspArray(2))%>
  <option value='<%=aspArray(0,i)%>'><%=aspArray(1,i)%></option>
<%next%>
</select>
as you can see, the For loop is located within the <select>, hence, I cannot set the c values dynamically.

Thanks!
 
Hi,
As far as I know ( and that may be the issue), a <select>'s options can only have 2 values, the data and the text ( they can be the same); I have not seen one with 3 values, nor would I know how it would be used..Perhaps a better explaination of what that code is trying to do would help.



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Well, I'd changed my approach a little using a little js popup to do the job. In another word, after user make selection for the drop down and hit select button, the onClick function will popup a window carying along is the dropdown selected VALUE, so that in the new window, I can have another asp/sql script to call the 3rd "c" data to work. Not sure the side-effects are going to be in the long run but, for now, I'm happy as a claim. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top