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

Post submit JS

bloh

Active member
#1
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.
 

wang

Well-known member
#2
I think the js file for that part is discussion.js, which can be located at this place. js/xenforo/discussion.js
 

bloh

Active member
#3
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?
 

wang

Well-known member
#4
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.
 

bloh

Active member
#5
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: