Click here to Skip to main content
15,894,410 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
C#
Dear All,


Am trying to display tree view structure based on the dropdown selection using JQUERY IN ASP.NET
i have done the tree view, if i select any dropdown value then its working fine
but i cannot display tree, if i select second value from dropdown

Note: i cannot display second option from dropdown 
      i alwways displaying only one selection

please let me know where i made a mistake.

JavaScript
// ======================================== //
		// ===> Selection Changed in Drop Down <=== //
		// ======================================== //
		
		$(function () 

						{
						try
						{
						 $("#cmbGroupName").on('click', function (e) 
						 {
						 LogInUser = document.getElementById("hdnuser").value;
						 var cmbGroupName=document.getElementById("cmbGroupName").options[document.getElementById("cmbGroupName").value].text;
						 var strxml2='SelectionChangeApp';
						 if(document.getElementById("cmbGroupName").options[document.getElementById("cmbGroupName").value].text != "Select GroupName")
						 {
						
                           $('#divAppMenus0').jstree({'plugins':["defaults","json_data","checkbox"],
                           'core' : {
                            data : {
                            type: "POST",
                            url : '../masterutil/GetMasterGroup_TEST.aspx?User=' + document.getElementById("cmbGroupName").options[document.getElementById("cmbGroupName").value].text + "&t=" + t + "&LogInUser="+ LogInUser + "&ReqMode="+ ReqMode+ "&strxml2="+ strxml2 + "&cmbGroupName="+ cmbGroupName,
                            contentType: "application/json; charset=utf-8",
                            dataType : "json"
                            
                                  
                                   }
                            });
                         }
                      
                         }
                      
                            
                         });
                         }
                         catch(e)
                         {
                              ShowScriptError(e,"cmbGroupName");
                         }
                         });


thanks in advance.

What I have tried:

Selection Changed in Drop Down using jquery
Posted
Updated 15-Mar-16 20:42pm

1 solution

$("#id option:selected").val()="Value";
try this for showing selected value in dropdown using jquery.
 
Share this answer
 
Comments
stellus 16-Mar-16 3:39am    
Hi thanks for your reply,
again am getting first option only

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900