DeveloperBarn Forums

DeveloperBarn

Programming & IT forum

triple combo ajax

This is a discussion on triple combo ajax within the ASP Development forums, part of the Programming & Scripting category; JMH save me!!! I have this double depended dropdown and I want to add a third one Code: <% Dim ...

Go Back   DeveloperBarn Forums > Programming & Scripting > ASP Development

  #1  
Old October 16th, 2008, 04:34 PM
dragon rider's Avatar
Barn Newbie
 
Join Date: Jul 2008
Posts: 11
Rep Power: 2
dragon rider is an unknown quantity at this point
Default triple combo ajax

JMH save me!!!

I have this double depended dropdown and I want to add a third one

Code:
<%
Dim rsProduct, str_sql
str_sql = "SELECT company, productid, product, kostos, timi_polisis, typefn, typeid, producttype " & _
		"FROM companies, products, producttypes where companyid = companyfn and typeid = typefn order by company, product"
Set rsProduct = my_conn.Execute(str_sql)

%>

<script language="javascript">
var dataArray = new Array(null<%
   If Not rsProduct.EOF Then rsProduct.MoveFirst
   Dim last_item
   

   Do Until rsProduct.EOF
   
      If last_item <> rsProduct("company") Then
         If len(last_item) > 0 Then Response.Write ")"
         Response.Write ",new Array(null"
         last_item = rsProduct("company")
      End If
      Response.Write ",new Array('" & rsProduct("productid") & "','" & rsProduct("product") & "','" & rsProduct("kostos") &"','" & rsProduct("timi_polisis") &"','" & rsProduct("producttype") & "')"
	  rsProduct.MoveNext
   Loop
   If len(last_item) > 0 Then Response.Write ")"
   %>);
   
   



function changeOptions(elemOne,elemTwo){
   for(i = elemTwo.options.length; i >= 1; i--)
   elemTwo.options[i] = null;
   elemTwo.selectedIndex = 0;

   if(elemOne.selectedIndex == 0)
      return false;
	  

   for(i=1;i<dataArray.length;i++){
      elemTwo.options[i] = new Option(dataArray[elemOne.selectedIndex][i][1],dataArray[elemOne.selectedIndex][i][0]);
   }
}



<select name="selCompany" class="dropdown" onChange="changeOptions(this,document.getElementsByName('sel  Product')[0])">
    <option value="">[ Επιλέξτε εταιρία ]</option>
    <%
    If Not rsProduct.BOF Then rsProduct.MoveFirst
	Dim last_company
    Do Until rsProduct.EOF
		If rsProduct("company") <> last_company Then
	        Response.Write "<option>" & rsProduct("company") & "</option>"
			last_company = rsProduct("company")
		End If
        rsProduct.MoveNext
    Loop
    %>
</select>


<select class="dropdown" name="selProduct">
    <option value="">[ Επιλέξτε Προϊόν ]</option>
</select>
I have tried it but I can't..
Please! You'll be my hero!
Reply With Quote
Reply

  DeveloperBarn Forums > Programming & Scripting > ASP Development

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
combo maker Rebelle ASP Development 21 October 1st, 2008 10:25 AM
.Net And Ajax smithcarvo .Net Development 2 August 20th, 2008 07:50 AM
Dynamic Combo Maker mehere ASP Code Samples 0 March 28th, 2008 09:40 AM
Using AJAX Auto Complete Extender with Database richyrich .Net Code Samples 0 March 26th, 2008 07:59 AM
Dynamic Content in AJAX Extender richyrich .Net Development 3 March 17th, 2008 12:14 PM


All times are GMT -4. The time now is 10:22 PM.


Copyright ©2008-2010, DeveloperBarn

Content Relevant URLs by vBSEO 3.3.2