开发者

Trigger Jquery Event after an onsubmit

I would like to trigger a Div to open after a form completes an action. But I need to it only happen based on one particular action so it is specific. I'm not sure where to开发者_如何学Go start.


Ok, so if a new page is not loaded after your form completes an action (i.e. you have submitted it), I would assume you mean you're not redirecting the user to a different page; you're just posting back the current "Cart" page with the updated data.

So your question is, "How do I display content on my page only following a postback".

While jQuery does all things, it's probably not needed here (if I've interpreted your problem correctly, at least).

You just need to check whether the page is being loaded for the first time or is being loaded in response to a postback. For that you use the Page.IsPostBack property:

<% if (Page.IsPostBack) { %>
   <div id="myMessage"><p>You added something to your cart.</p></div>
<% } %>

If this isn't what you meant, you need to explain your question a bit more.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜