The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Automatic Form javascript code don't work anymore on ModernBB

View previous topic View next topic Go down

Automatic Form javascript code don't work anymore on ModernBB

Post by Manata on 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/
avatar
Manata
New Member

Posts : 24
Reputation : 4
Language : English

http://www.promotionstorm.com/

Back to top Go down

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

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

Hi, @Manata.

Are you referring to this code?
avatar
Draxion
Support Moderator
Support Moderator

Male Posts : 1052
Reputation : 156
Language : English
Location : USA

http://dawnofthedragons.forumotion.com/

Back to top Go down

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

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

Yes.
avatar
Manata
New Member

Posts : 24
Reputation : 4
Language : English

http://www.promotionstorm.com/

Back to top Go down

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

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

Can you please post the code you are using here?
avatar
Draxion
Support Moderator
Support Moderator

Male Posts : 1052
Reputation : 156
Language : English
Location : USA

http://dawnofthedragons.forumotion.com/

Back to top Go down

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

Post by Manata on 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]');
  }
});
avatar
Manata
New Member

Posts : 24
Reputation : 4
Language : English

http://www.promotionstorm.com/

Back to top Go down

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

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

Okay, thanks. Which part of the forum is this for?
avatar
Draxion
Support Moderator
Support Moderator

Male Posts : 1052
Reputation : 156
Language : English
Location : USA

http://dawnofthedragons.forumotion.com/

Back to top Go down

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

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

All forums in Services category + Post and Affiliate Exchange + Battles
avatar
Manata
New Member

Posts : 24
Reputation : 4
Language : English

http://www.promotionstorm.com/

Back to top Go down

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

Post by Draxion on 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?
avatar
Draxion
Support Moderator
Support Moderator

Male Posts : 1052
Reputation : 156
Language : English
Location : USA

http://dawnofthedragons.forumotion.com/

Back to top Go down

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

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

No, I didn't.
avatar
Manata
New Member

Posts : 24
Reputation : 4
Language : English

http://www.promotionstorm.com/

Back to top Go down

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

Post by Draxion on 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
avatar
Draxion
Support Moderator
Support Moderator

Male Posts : 1052
Reputation : 156
Language : English
Location : USA

http://dawnofthedragons.forumotion.com/

Back to top Go down

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

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

Yes, only when creating a new topic.
avatar
Manata
New Member

Posts : 24
Reputation : 4
Language : English

http://www.promotionstorm.com/

Back to top Go down

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

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

Sorry, I meant did you put the JavaScript to be placed in 'all pages'?
avatar
Draxion
Support Moderator
Support Moderator

Male Posts : 1052
Reputation : 156
Language : English
Location : USA

http://dawnofthedragons.forumotion.com/

Back to top Go down

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

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

Of course.
avatar
Manata
New Member

Posts : 24
Reputation : 4
Language : English

http://www.promotionstorm.com/

Back to top Go down

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

Post by Draxion on 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]');
  }
});
avatar
Draxion
Support Moderator
Support Moderator

Male Posts : 1052
Reputation : 156
Language : English
Location : USA

http://dawnofthedragons.forumotion.com/

Back to top Go down

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

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

Still not working.
avatar
Manata
New Member

Posts : 24
Reputation : 4
Language : English

http://www.promotionstorm.com/

Back to top Go down

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

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

Solved via PM.
avatar
Draxion
Support Moderator
Support Moderator

Male Posts : 1052
Reputation : 156
Language : English
Location : USA

http://dawnofthedragons.forumotion.com/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum