1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Post submit JS

Discussion in 'XenForo Development Discussions' started by bloh, Nov 29, 2015.

  1. bloh

    bloh Active Member

    May I know where is the JS file for:
    When submit button is clicked & it checks for the validity of the message & if it passes the test, it post the new message.

    I want to insert some JS after the post is successfully submitted.

    Any guidance would be appreciated.
  2. wang

    wang Well-Known Member

    I think the js file for that part is discussion.js, which can be located at this place. js/xenforo/discussion.js
  3. bloh

    bloh Active Member

    Thanks for your reply.
    I tried to look into discussion.js but I couldn't determine which part of the code is the one that I'm looking for: "when the post is successfully submitted"

    Would you mind to point me at the right direction?
  4. wang

    wang Well-Known Member

    Looking at your first post, I do not think that you need to insert to js. But I could be wrong if I have misunderstood you. Can you please post here in full what you are precisely trying to achive? I will have a better understanding that way.
  5. bloh

    bloh Active Member

    I want to achieve this:
    When I successfully submitted a post, preferably it will scroll to the #newpost. If not possible, second best option is to scroll to the bottom of the page.

    This is because I want to set the post editor "position: fixed".
    When a user submit a post, it may be at the top of the page. So, I need it to scroll down to the new post after submitting.

    Hope I make it clear for you.
    Last edited: Nov 29, 2015

Share This Page