English 中文(简体)
植被json jquery打字,在填满后可重新使用
原标题:disable select dropdown during .getjson jquery call and reenable after complete

i 在我被点击后,有以下代码。 有时需要很长的时间,用户在服务器侧处理过程中再次点击退。

是否在服务器一边停机,在完成处理后重新安装。

我的法典

 <script type="text/javascript">
        $(document).ready(function() {

            $( #userDropdown ).change(function() {
                if (this.selectedIndex != 0) {
                    var URL = "/Users/GetUserJson/" + this.value;

                    $.getJSON(URL, function(data) {

                         var userID = data.UserId;
                         var userColor = data.UserColor;

                         . . . .
最佳回答

否定建议你掩盖选择,但我只听说听说是站不住脚的。

$( #userDropdown ).change(function() {
    // Assign the select in a variable
    var sel = $(this);
    if (this.selectedIndex != 0) {
        // Disable it
        sel.attr( disabled ,  disabled )
        var URL = "/Users/GetUserJson/" + this.value;

        $.getJSON(URL, function(data) {

            var userID = data.UserId;
            var userColor = data.UserColor;

            // Enable it
            sel.removeAttr( disabled );

            ...
问题回答

暂无回答




相关问题
PHP Combo Box AJAX Refresh

I have a PHP page that currently has 4 years of team positions in columns on the page. The client wants to select the players in positions and have first, second and thrid choices. Currently the page ...

jquery + ajax + json + fill dropdown list not working

I m pretty sure i am almost there....but i cannot figure out how to iterate through json objects and fill a dropdown list. Here is the js code: My JSON data returned:{"name":"County1","name":"County1"...

Gridviews and DropdownLists

Is it possible to change the data source of a dropdown list in a gridview from another dropdown list selected index changed method in the same gridview? for example I have a dropdown that needs to ...

Adding a new value to the drop down list box

I have a drop down list box which has one of the values to be others. I want to move these value to the last. Please help me with this. The code i am using is as follows ddlAssetsCountryOthersone....

Show hide div using codebehind

I have a DropDownList for which I am trying to show a div OnSelectedIndexChanged but it says OBJECT REQUIRED. I am binding the DataList in that div: aspx: <asp:DropDownList runat="server" ID="...

Why might dropdownlist.SelectedIndex = value fail?

I have a dropdown list that I am binding to a datatable. Here is the code I am using to do it: ddlBuildAddr.DataSource = buildings ddlBuildAddr.DataTextField = "buildingName" ddlBuildAddr....

热门标签