Jquery:有时候我的下拉值没有改变? [英] Jquery: some time my drop down value is not getting changed?

查看:85
本文介绍了Jquery:有时候我的下拉值没有改变?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Jquery:我在document.readyfunction上调用了textbox的onchange事件。我在onchange上调用了一个方法,它从数据库中获取值并为控件分配值。有时我的下拉值没有改变吗?随机出现这个问题。



我尝试过:



< input type =textid =txtmidmaxlength = 15onchange =GetISFDetails(this)class =mws-textinput numbersOnly mandatorystyle =font-family:PTSansRegular,Arial,Helvetica,sans-serif; font-size:13.4915px;> 





 var vars = [],hash; 
var hashes = window.location.href.slice(window.location.href.indexOf('?')+ 1).split('&');
for(var i = 0; i< hashes.length; i ++){
hash = hashes [i] .split('=');
vars.push(hash [0]);
vars [hash [0]] = hash [1];
// if(vars [hash [0]] ==|| vars [hash [0]] ==0){
$('。tblmid')。find(' 。#txtmid')VAL(瓦尔[散列[0]]);
$('。tblmid')。find('#txtmid')。change();
//}
}





函数GetISFDetails(obj){
debugger
var jqddlobject = $(obj);
< pre> var obj = $ .parseJSON(data.d);
for(var a = 0; a< 2; a ++){

if(a == 0){
for(var c = 0; c< obj [a] .length; c ++){
jqddlobject.closest('table')。find('。ddlMstatus')。val(obj [a] [c] .STATUS);
jqddlobject.closest('table')。find('。ddlMstatus')。trigger(liszt:updated);
}}< pre>

解决方案

('。tblmid')。find('#txtmid')。val (乏[散列[0]]);

( 'tblmid ')找到(' #txtmid')变化();
//}
}





函数GetISFDetails(obj){
debugger
var jqddlobject =


(obj);
< pre> var obj =


Jquery:I called onchange event of textbox on document.readyfunction. i have called method on onchange which fetching the value from database and assigning values to controls.some time my drop down value is not getting changed?randomly this issue occurred.

What I have tried:

<input type="text" id="txtmid" maxlength="15" onchange="GetISFDetails(this)" class="mws-textinput numbersOnly mandatory" style="font-family: PTSansRegular, Arial, Helvetica, sans-serif; font-size: 13.4915px;">



 var vars = [], hash;
            var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
            for (var i = 0; i < hashes.length; i++) {
                hash = hashes[i].split('=');
                vars.push(hash[0]);
                vars[hash[0]] = hash[1];
//                if (vars[hash[0]] == "" || vars[hash[0]] == "0") {
                    $('.tblmid').find('#txtmid').val(vars[hash[0]]);
                    $('.tblmid').find('#txtmid').change();
              //  }
            }



  function GetISFDetails(obj) {
            debugger
            var jqddlobject = $(obj);
<pre> var obj = $.parseJSON(data.d);
                    for (var a = 0; a < 2; a++) {

                        if (a == 0) {
                            for (var c = 0; c < obj[a].length; c++) {
jqddlobject.closest('table').find('.ddlMstatus').val(obj[a][c].STATUS);
                                jqddlobject.closest('table').find('.ddlMstatus').trigger("liszt:updated");
}}<pre>

解决方案

('.tblmid').find('#txtmid').val(vars[hash[0]]);


('.tblmid').find('#txtmid').change(); // } }



  function GetISFDetails(obj) {
            debugger
            var jqddlobject =


(obj); <pre> var obj =


这篇关于Jquery:有时候我的下拉值没有改变?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆