Automatic Form javascript code don't work anymore on ModernBB Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.
2 posters

    Automatic Form javascript code don't work anymore on ModernBB

    Manata
    Manata
    New Member


    Posts : 24
    Reputation : 4
    Language : English

    Automatic Form javascript code don't work anymore on ModernBB Empty Automatic Form javascript code don't work anymore on ModernBB

    Post by Manata March 24th 2017, 8:18 am

    Hi! Moved my forum to ModernBB. The Automatic Form javascript was working till last night ( was working on ModernBB but for a while ). Now it just don't work anymore. My forum URL is: http://www.promotionstorm.com/
    Draxion
    Draxion
    Helper
    Helper


    Male Posts : 2518
    Reputation : 321
    Language : English
    Location : USA

    Automatic Form javascript code don't work anymore on ModernBB Empty Re: Automatic Form javascript code don't work anymore on ModernBB

    Post by Draxion March 24th 2017, 9:14 am

    Hi, @Manata.

    Are you referring to this code?
    Manata
    Manata
    New Member


    Posts : 24
    Reputation : 4
    Language : English

    Automatic Form javascript code don't work anymore on ModernBB Empty Re: Automatic Form javascript code don't work anymore on ModernBB

    Post by Manata March 24th 2017, 9:34 am

    Yes.
    Draxion
    Draxion
    Helper
    Helper


    Male Posts : 2518
    Reputation : 321
    Language : English
    Location : USA

    Automatic Form javascript code don't work anymore on ModernBB Empty Re: Automatic Form javascript code don't work anymore on ModernBB

    Post by Draxion March 24th 2017, 9:35 am

    Can you please post the code you are using here?
    Manata
    Manata
    New Member


    Posts : 24
    Reputation : 4
    Language : English

    Automatic Form javascript code don't work anymore on ModernBB Empty Re: Automatic Form javascript code don't work anymore on ModernBB

    Post by Manata March 24th 2017, 9:38 am

    It was working till last night.

    Code:
    $(function() {
        if (location.pathname == '/post' && location.search == '?f=4&mode=newtopic') {
          $('#text_editor_textarea').val('[b]Forum/Website Name:[/b]\n[b]URL:[/b]\n[b]Your nickname on the Forum/Website:[/b]\n[b]Description:[/b]');
        }
    });

    $(function() {
        if (location.pathname == '/post' && location.search == '?f=18&mode=newtopic') {
          $('#text_editor_textarea').val('[b]Forum/Website Name:[/b]\n[b]URL:[/b]\n[b]Your nickname on the Forum/Website:[/b]\n[b]Description:[/b]');
        }
    });

    $(function() {
        if (location.pathname == '/post' && location.search == '?f=19&mode=newtopic') {
          $('#text_editor_textarea').val('[b]Forum/Website Name:[/b]\n[b]URL:[/b]\n[b]Your nickname on the Forum/Website:[/b]\n[b]Description:[/b]');
        }
    });

    $(function() {
        if (location.pathname == '/post' && location.search == '?f=20&mode=newtopic') {
          $('#text_editor_textarea').val('[b]Forum/Website Name:[/b]\n[b]URL:[/b]\n[b]Your nickname on the Forum/Website:[/b]\n[b]Description:[/b]');
        }
    });

    $(function() {
        if (location.pathname == '/post' && location.search == '?f=22&mode=newtopic') {
          $('#text_editor_textarea').val('[b]Forum/Website Name:[/b]\n[b]URL:[/b]\n[b]Your nickname on the Forum/Website:[/b]\n[b]Description:[/b]');
        }
    });

    $(function() {
        if (location.pathname == '/post' && location.search == '?f=5&mode=newtopic') {
          $('#text_editor_textarea').val('[b]Forum/Website Name:[/b]\n[b]URL:[/b]\n[b]Review Type:[/b]\n[b]Review Areas:[/b]\n[b]Extra Notes:[/b]');
        }
    });

    $(function() {
        if (location.pathname == '/post' && location.search == '?f=6&mode=newtopic') {
          $('#text_editor_textarea').val('[b]Forum/Website Name:[/b]\n[b]URL:[/b]\n[b]Package Type:[/b]\n[b]Extra Notes:[/b]');
        }
    });

    $(function() {
        if (location.pathname == '/post' && location.search == '?f=7&mode=newtopic') {
          $('#text_editor_textarea').val('[b]Forum/Website Name:[/b]\n[b]URL:[/b]\n[b]Advertising Type:[/b]\n[b]Extra Notes:[/b]');
        }
    });

    $(function() {
        if (location.pathname == '/post' && location.search == '?f=8&mode=newtopic') {
          $('#text_editor_textarea').val('[b]Forum/Website Name:[/b]\n[b]URL:[/b]\n[b]Exchange Type:[/b]\n[b]Extra Notes:[/b]');
        }
    });

    $(function() {
        if (location.pathname == '/post' && location.search == '?f=26&mode=newtopic') {
          $('#text_editor_textarea').val('[b]Forum/Website Name:[/b]\n[b]URL:[/b]\n[b]Exchange:[/b]\n[b]Extra Notes:[/b]');
        }
    });

    $(function() {
        if (location.pathname == '/post' && location.search == '?f=11&mode=newtopic') {
          $('#text_editor_textarea').val('[b]Forum/Website Name:[/b]\n[b]URL:[/b]\n[b]Category:[/b]\n[b]Extra Notes:[/b]');
        }
    });
    Draxion
    Draxion
    Helper
    Helper


    Male Posts : 2518
    Reputation : 321
    Language : English
    Location : USA

    Automatic Form javascript code don't work anymore on ModernBB Empty Re: Automatic Form javascript code don't work anymore on ModernBB

    Post by Draxion March 24th 2017, 9:41 am

    Okay, thanks. Which part of the forum is this for?
    Manata
    Manata
    New Member


    Posts : 24
    Reputation : 4
    Language : English

    Automatic Form javascript code don't work anymore on ModernBB Empty Re: Automatic Form javascript code don't work anymore on ModernBB

    Post by Manata March 24th 2017, 9:42 am

    All forums in Services category + Post and Affiliate Exchange + Battles
    Draxion
    Draxion
    Helper
    Helper


    Male Posts : 2518
    Reputation : 321
    Language : English
    Location : USA

    Automatic Form javascript code don't work anymore on ModernBB Empty Re: Automatic Form javascript code don't work anymore on ModernBB

    Post by Draxion March 24th 2017, 9:45 am

    Did you add any other JavaScripts or CSS, or any template editing before you noticed the JavaScript ceasing to work?
    Manata
    Manata
    New Member


    Posts : 24
    Reputation : 4
    Language : English

    Automatic Form javascript code don't work anymore on ModernBB Empty Re: Automatic Form javascript code don't work anymore on ModernBB

    Post by Manata March 24th 2017, 9:46 am

    No, I didn't.
    Draxion
    Draxion
    Helper
    Helper


    Male Posts : 2518
    Reputation : 321
    Language : English
    Location : USA

    Automatic Form javascript code don't work anymore on ModernBB Empty Re: Automatic Form javascript code don't work anymore on ModernBB

    Post by Draxion March 24th 2017, 9:46 am

    Okay, and you have that targeted only in all pages, correct?

    EDIT: Meant all pages.


    Last edited by Draxion on March 24th 2017, 9:47 am; edited 1 time in total
    Manata
    Manata
    New Member


    Posts : 24
    Reputation : 4
    Language : English

    Automatic Form javascript code don't work anymore on ModernBB Empty Re: Automatic Form javascript code don't work anymore on ModernBB

    Post by Manata March 24th 2017, 9:47 am

    Yes, only when creating a new topic.
    Draxion
    Draxion
    Helper
    Helper


    Male Posts : 2518
    Reputation : 321
    Language : English
    Location : USA

    Automatic Form javascript code don't work anymore on ModernBB Empty Re: Automatic Form javascript code don't work anymore on ModernBB

    Post by Draxion March 24th 2017, 9:48 am

    Sorry, I meant did you put the JavaScript to be placed in 'all pages'?
    Manata
    Manata
    New Member


    Posts : 24
    Reputation : 4
    Language : English

    Automatic Form javascript code don't work anymore on ModernBB Empty Re: Automatic Form javascript code don't work anymore on ModernBB

    Post by Manata March 24th 2017, 9:49 am

    Of course.
    Draxion
    Draxion
    Helper
    Helper


    Male Posts : 2518
    Reputation : 321
    Language : English
    Location : USA

    Automatic Form javascript code don't work anymore on ModernBB Empty Re: Automatic Form javascript code don't work anymore on ModernBB

    Post by Draxion March 24th 2017, 9:51 am

    Hmm, I'm not sure what could cause it from not working other than possibly other JavaScripts in the same area overriding it. Let's try rewriting the code so it only works under one function. Replace the code with this and give it a go.

    Code:
    $(function() {
      if (location.pathname == '/post' && location.search == '?f=4&mode=newtopic') {
        $('#text_editor_textarea').val('[b]Forum/Website Name:[/b]\n[b]URL:[/b]\n[b]Your nickname on the Forum/Website:[/b]\n[b]Description:[/b]');
      }
      if (location.pathname == '/post' && location.search == '?f=18&mode=newtopic') {
        $('#text_editor_textarea').val('[b]Forum/Website Name:[/b]\n[b]URL:[/b]\n[b]Your nickname on the Forum/Website:[/b]\n[b]Description:[/b]');
      }

      if (location.pathname == '/post' && location.search == '?f=19&mode=newtopic') {
        $('#text_editor_textarea').val('[b]Forum/Website Name:[/b]\n[b]URL:[/b]\n[b]Your nickname on the Forum/Website:[/b]\n[b]Description:[/b]');
      }

      if (location.pathname == '/post' && location.search == '?f=20&mode=newtopic') {
        $('#text_editor_textarea').val('[b]Forum/Website Name:[/b]\n[b]URL:[/b]\n[b]Your nickname on the Forum/Website:[/b]\n[b]Description:[/b]');
      }

      if (location.pathname == '/post' && location.search == '?f=22&mode=newtopic') {
        $('#text_editor_textarea').val('[b]Forum/Website Name:[/b]\n[b]URL:[/b]\n[b]Your nickname on the Forum/Website:[/b]\n[b]Description:[/b]');
      }

      if (location.pathname == '/post' && location.search == '?f=5&mode=newtopic') {
        $('#text_editor_textarea').val('[b]Forum/Website Name:[/b]\n[b]URL:[/b]\n[b]Review Type:[/b]\n[b]Review Areas:[/b]\n[b]Extra Notes:[/b]');
      }

      if (location.pathname == '/post' && location.search == '?f=6&mode=newtopic') {
        $('#text_editor_textarea').val('[b]Forum/Website Name:[/b]\n[b]URL:[/b]\n[b]Package Type:[/b]\n[b]Extra Notes:[/b]');
      }

      if (location.pathname == '/post' && location.search == '?f=7&mode=newtopic') {
        $('#text_editor_textarea').val('[b]Forum/Website Name:[/b]\n[b]URL:[/b]\n[b]Advertising Type:[/b]\n[b]Extra Notes:[/b]');
      }

      if (location.pathname == '/post' && location.search == '?f=8&mode=newtopic') {
        $('#text_editor_textarea').val('[b]Forum/Website Name:[/b]\n[b]URL:[/b]\n[b]Exchange Type:[/b]\n[b]Extra Notes:[/b]');
      }

      if (location.pathname == '/post' && location.search == '?f=26&mode=newtopic') {
        $('#text_editor_textarea').val('[b]Forum/Website Name:[/b]\n[b]URL:[/b]\n[b]Exchange:[/b]\n[b]Extra Notes:[/b]');
      }

      if (location.pathname == '/post' && location.search == '?f=11&mode=newtopic') {
        $('#text_editor_textarea').val('[b]Forum/Website Name:[/b]\n[b]URL:[/b]\n[b]Category:[/b]\n[b]Extra Notes:[/b]');
      }
    });
    Manata
    Manata
    New Member


    Posts : 24
    Reputation : 4
    Language : English

    Automatic Form javascript code don't work anymore on ModernBB Empty Re: Automatic Form javascript code don't work anymore on ModernBB

    Post by Manata March 24th 2017, 9:53 am

    Still not working.
    Draxion
    Draxion
    Helper
    Helper


    Male Posts : 2518
    Reputation : 321
    Language : English
    Location : USA

    Automatic Form javascript code don't work anymore on ModernBB Empty Re: Automatic Form javascript code don't work anymore on ModernBB

    Post by Draxion March 24th 2017, 10:07 am

    Solved via PM.