开发者

problem in populating the values an then selecting in 2 different ajaxcalls

I 开发者_StackOverflow中文版am having a strange problem. There are two ajax calls in the code. The first onClick I want to use to populate the list and the second onfocus I am using on select a value to make an ajax call to other jsp script. This code is just making the second call and not the first. Another thing I want is to send the list index in the url of the second ajax call. I know how to select the index value (h=this.selectedIndex;) but I am not able to send it if I use it with this code as "http://*/check/index.jsp&id=6&vid="+h


If you look at event handler for your select

  • onClick - object on a form is clicked.
  • onFocus - window, frame, frameset or form element receives focus.

It shows that immediately after click event occurs, select control get onFocus event and thats why second AJAX call always executes.

Why don't you try something like calling second method on onChange event instead of onFocus like:

<select id='t1' onClick="Click();" onChange="handleButtonClick();"> </select>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜