OnBlur Issue in JQuery Calendar
I have a DatimePicker written in jQuery, which consists of a input text and a button. On click开发者_如何学编程ing the button, the calendar will be launched/shown.
Now , the issue is that I have server-side onChange event on the input text. When I put the cursor on the textbox and click the button to launch the calendar, instead of launching the calendar directly, server-side postback occurs. I don't want this behavior and don't know how to solve it. It means, if focus is moved from the input to the button, I do NOT want onBlur to occur. How can I solve this??You can prevent the postback from happening by returning false in your jQuery event function attached to the button.
i think you are using asp:button,in which runat is set to server.if then that is the reason of the post back.replace asp:button with <
input type="button" onclick="your java script function"/>
You should probably post some code to get a more specific answer.
If you are using an <asp:TextBox />
, make sure that AutoPostBack is set to false (this should be the default).
If your jquery datepicker uses a click on a button to trigger the popup it should be ensuring no default behviour of the button occurs. You definatley shouldn't use an <asp:Button />
server control to avoid asp.net Postback interference. Use an <input type='button' />
or image.
精彩评论