-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: Raghu_78
Message 2 in Discussion


To 
acheive this u need to do -
 1. In the OnChange event of the combo1 call Java script 
function inorder to populate the values to combo2 ...& Pass some params to 
that method
 2. Send-in the array of data to the client while loading the page 
itself..
 3. Submit the page to server in the onchange() event of combo2.(may 
be selectIndexChnaged event)...
 
    Refer these code blocks -
 
    I. Calling 
Point Combo1: 
        populateDependentCombo(Combo2, 
arrayCombo2Values, this.value) 
 
    II. Actual 
Function to populate values to Combo2: (General 
implementation)
    //Purpose: Populate dependent combo with data 
array
    function populateDependentCombo(cboDest, arrData, 
strValue)
    
{
           //Evaluate the 
given object [string or combo] to combo 
object
           
cboDestination = 
eval("document.all['"+cboDest+"']");    
   
           
if (cboDestination != null && arrData != 
null)
           
{
                      
//delete all options of dest 
combo
                      cboDestination.options.length=0;

                  //Populate 
the destination combo with data retrieved from 
dataArray
                  for(i=0; 
i<arrData.length; 
i++)
                  {
                       //If 
data.base matches with strValue then add to the destination 
combo
                       if 
(arrData[i].base == 
strValue)
                       {
                            //Create 
a new Option object and assign data to 
it
                            cboDestination.options[cboDestination.options.length] 
= new 
Option(arrData[i].literal,arrData[i].id);       
                       }
                  }  
           
}   
    }
    III Sending the 
array to the client -

        function data(base, id, 
literal)
        {    
this.base = base; //Dependent Combo1 
Value
             
this.id = id; //Combo2 
Value
             
this.literal = 
literal;//Combo2 Literal
        
}
 
        Combo2Values = new 
Array();
        
Combo2Values[Combo2Values.length]= new data(1,1,"with out any 
body_s");
        
Combo2Values[Combo2Values.length]= new data(2,2,"ISO Std. 
7.15_s");        

    



  -----Original Message-----
From: Aspnetstarter1 
  [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 26, 2004 9:18 
  PM
To: BDOTNET
Subject: populating dropdown list control 
  using javascript


  
    
      
      New Message on BDOTNET
    
      

  populating dropdown list control using 
    javascript


    
      
      
        Reply

        
          
            
            
               
              Reply to Sender   Recommend 
              Message 1 in 
                Discussion 
      
        
          
            
            
              From: Aspnetstarter1 

            
              

                Hi
                 
                I have 2 dropdown controls in a page. If i select a 
                dropdown value i have to populate the second dropdown with some 
                values using javascript and after selecting the second dropdown 
                value, i have to submit the page. That time i have to access the 
                second dropdown value as well.
                 
                Can anyone give me the 
        solution.
View other groups in this 
    category. 



DISCLAIMER:
This message (including attachment if any) is confidential and may be privileged. 
Before opening attachments please check them for viruses and defects. MindTree 
Consulting Private Limited (MindTree) will not be responsible for any viruses or 
defects or any forwarded attachments emanating either from within MindTree or outside. 
If you have received this message by mistake please notify the sender by return  
e-mail and delete this message from your system. Any unauthorized use or dissemination 
of this message in whole or in part is strictly prohibited.  Please note that e-mails 
are susceptible to change and MindTree shall not be liable for any improper, untimely 
or incomplete transmission.

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to