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/
2 posters
Automatic Form javascript code don't work anymore on ModernBB
Manata- New Member
- Posts : 24
Reputation : 4
Language : English
Draxion- Helper
- Posts : 2518
Reputation : 321
Language : English
Location : USA
Manata- New Member
- Posts : 24
Reputation : 4
Language : English
Yes.
Draxion- Helper
- Posts : 2518
Reputation : 321
Language : English
Location : USA
Can you please post the code you are using here?
Manata- New Member
- Posts : 24
Reputation : 4
Language : English
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- Helper
- Posts : 2518
Reputation : 321
Language : English
Location : USA
Okay, thanks. Which part of the forum is this for?
Manata- New Member
- Posts : 24
Reputation : 4
Language : English
All forums in Services category + Post and Affiliate Exchange + Battles
Draxion- Helper
- Posts : 2518
Reputation : 321
Language : English
Location : USA
Did you add any other JavaScripts or CSS, or any template editing before you noticed the JavaScript ceasing to work?
Manata- New Member
- Posts : 24
Reputation : 4
Language : English
No, I didn't.
Draxion- Helper
- Posts : 2518
Reputation : 321
Language : English
Location : USA
Okay, and you have that targeted only in all pages, correct?
EDIT: Meant all pages.
EDIT: Meant all pages.
Last edited by Draxion on March 24th 2017, 9:47 am; edited 1 time in total
Manata- New Member
- Posts : 24
Reputation : 4
Language : English
Yes, only when creating a new topic.
Draxion- Helper
- Posts : 2518
Reputation : 321
Language : English
Location : USA
Sorry, I meant did you put the JavaScript to be placed in 'all pages'?
Manata- New Member
- Posts : 24
Reputation : 4
Language : English
Of course.
Draxion- Helper
- Posts : 2518
Reputation : 321
Language : English
Location : USA
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- New Member
- Posts : 24
Reputation : 4
Language : English
Still not working.
Draxion- Helper
- Posts : 2518
Reputation : 321
Language : English
Location : USA
Solved via PM.