ASP Form problem

Discussion in 'C#' started by rag84dec, Dec 9, 2007.

  1. #1
    I have a table which has rows filled with comboboxes...Each commo box has same number of elements.
    And if i change the first column's combo box to some element then i want all the elements in the
    combo box to be changed.And i have a submit button at the end to collect all the data.So how can
    i implement in "ASP"
     
    rag84dec, Dec 9, 2007 IP
  2. imvain2

    imvain2 Peon

    Messages:
    218
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Actually you will be using javascript. You will need to add onchange to your combo boxes

    For your combo boxes
    
    <select onchange="ChangeAll(this.form,this);"
    
    HTML:
    
    <script>
    function ChangeAll(FRM,SelBox){
    	var SelPos = SelBox.options.selectedIndex;
    	for(X=0;X<=FRM.elements.length;X++){
    		var FldType = FRM.elements[X].type;
    		if(FldType.indexOf("select")>=0){
    			alert(FRM.elements[X].type);		
    			FRM.elements[X].options.selectedIndex = SelPos;
    		}
    	}
    }
    </script>
    
    Code (markup):
     
    imvain2, Dec 9, 2007 IP
  3. imvain2

    imvain2 Peon

    Messages:
    218
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You will be using javascript to change the select boxes, however you can use asp to collect the data.
     
    imvain2, Dec 9, 2007 IP