开发者

Jquery/struts 1 combobox dynamic

I have two combobox which are linked i.e if you select one , another combobox will have corresponding data. I am using jQuery to call the struts action via ajax. From struts actions side, it is sending the latest data based upon the valuse selcted from first copmbobox but it is not reflected on the page. Do I have to refresh the whole page/form? If yes, then what is the point of using ajax?

$(document).ready(function() { 

        $("#marketchange").change(function() { 
            var marketCode = $(this).val();
            //var marketCode1 = document.getElementById("marketCode").value();
            //alert(marketCode1);
             $.ajax({  
                 type: "GET",  
                 url: '<%=contextPath%>/manageRangesAction.do?actionToTake=getIslandsForMarket',  
                 data: ({ market: marketCode }),
                 success: function(data){
                    alert(data)
                  }
             });   
            });

The data in form is not updated. From struts side the arraylist for second combobox is changed but not refreshed on the jsp page.

And in general how do 开发者_运维问答we update the form data whenever we make any ajax call to server side?


At work we use AjaxTags

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜