本文介绍了使用jquery在下拉列表中更改选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 亲爱的所有人, 我试图根据下拉选择显示树视图结构使用 ASP.NET i中的JQUERY已完成树视图,如果选择任何下拉值然后它工作正常但我无法显示树,如果 i 选择第二个值 来自下拉列表 注意:我无法显示第二个选项来自下拉列表i alwways只显示一个选项 请让我知道我犯了什么错误。 // ======================================== // // ===>选择在下拉菜单中更改< === // // ==== ==================================== // $( function () { try { $( #cmbGroupName)。on(' 点击, 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':[ 默认值, json_data, 复选框], ' co re':{ 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); } }); 提前感谢。 我尝试过: 使用jquery 解决方案 ( function () { 尝试 { ( #cmbGroupName)。on(' click',函数(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!= 选择GroupName) { (' #divAppMenus0')。jstree({' plugins':[ 默认, json_data, 复选框], ' core':{数据:{类型: 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); } }); 提前感谢。 我尝试过: 使用jquery Dear All,Am trying to display tree view structure based on the dropdown selection using JQUERY IN ASP.NETi have done the tree view, if i select any dropdown value then its working finebut i cannot display tree, if i select second value from dropdownNote: i cannot display second option from dropdown i alwways displaying only one selectionplease let me know where i made a mistake.// ======================================== //// ===> 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 解决方案 (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 这篇关于使用jquery在下拉列表中更改选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-22 07:41