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.

default message

5 posters

Page 1 of 2 1, 2  Next

Go down

Solved default message

Post by darkgoku October 18th 2014, 18:36

i sued this tutorial http://www.fmcodes.com/t797-set-default-message-in-a-textarea but when i went to create a enw topic nothing showed up
btw my forum version is punbb


Last edited by darkgoku on October 18th 2014, 20:18; edited 2 times in total
darkgoku
darkgoku
Forumember

Posts : 340
Reputation : 3
Language : English

Back to top Go down

Solved Re: default message

Post by Ramdaman October 18th 2014, 18:37

Is your forum version phpBB3?
Ramdaman
Ramdaman
Active Poster

Male Posts : 1615
Reputation : 99
Language : English, Albanian, Macedonian, Russian | HTML, CSS
Location : New York City

http://ndihme.forumotion.com/forum

Back to top Go down

Solved Re: default message

Post by darkgoku October 18th 2014, 18:38

it is not it is punbb
darkgoku
darkgoku
Forumember

Posts : 340
Reputation : 3
Language : English

Back to top Go down

Solved Re: default message

Post by darkgoku October 18th 2014, 18:40

i just noticed the version difference but is there a way i can do it for punbb
darkgoku
darkgoku
Forumember

Posts : 340
Reputation : 3
Language : English

Back to top Go down

Solved Re: default message

Post by Ramdaman October 18th 2014, 18:40

You must change f=FORUMID to the ID of the forum you want this to work in.

Did you change the "f=FORUMID" ?
Ramdaman
Ramdaman
Active Poster

Male Posts : 1615
Reputation : 99
Language : English, Albanian, Macedonian, Russian | HTML, CSS
Location : New York City

http://ndihme.forumotion.com/forum

Back to top Go down

Solved Re: default message

Post by darkgoku October 18th 2014, 18:42

my forum version is punbb is there a way i can change the code to work for punbb
darkgoku
darkgoku
Forumember

Posts : 340
Reputation : 3
Language : English

Back to top Go down

Solved Re: default message

Post by Ramdaman October 18th 2014, 18:44

It said that it should work on other versions. Did you change the FORUMID?
Ramdaman
Ramdaman
Active Poster

Male Posts : 1615
Reputation : 99
Language : English, Albanian, Macedonian, Russian | HTML, CSS
Location : New York City

http://ndihme.forumotion.com/forum

Back to top Go down

Solved Re: default message

Post by darkgoku October 18th 2014, 18:49

i did that it did not work maybe u can provide me with example
darkgoku
darkgoku
Forumember

Posts : 340
Reputation : 3
Language : English

Back to top Go down

Solved Re: default message

Post by Ramdaman October 18th 2014, 18:59

Can I get a link to your forum? And which forum do you want this to be for.
Ramdaman
Ramdaman
Active Poster

Male Posts : 1615
Reputation : 99
Language : English, Albanian, Macedonian, Russian | HTML, CSS
Location : New York City

http://ndihme.forumotion.com/forum

Back to top Go down

Solved Re: default message

Post by darkgoku October 18th 2014, 19:01

its  down at the bottom the suggestions forum
darkgoku
darkgoku
Forumember

Posts : 340
Reputation : 3
Language : English

Back to top Go down

Solved Re: default message

Post by Ramdaman October 18th 2014, 19:03

If you can't help me, I can't help you. Please provide me with a link to your forum, and which forum inside your forum do you want this to be for.

Also, paste the code you're using here in a [code] bbcode as I cannot see the code on that link.
Ramdaman
Ramdaman
Active Poster

Male Posts : 1615
Reputation : 99
Language : English, Albanian, Macedonian, Russian | HTML, CSS
Location : New York City

http://ndihme.forumotion.com/forum

Back to top Go down

Solved Re: default message

Post by darkgoku October 18th 2014, 19:09

Code:
$(function() {
    if (document.location.href.indexOf('post?f=FORUMID&mode=newtopic') > -1) {
       $('#text_editor_textarea').val('CONTENT');
    }
});

http://www.academyofeca.forumotion.com the forum i want with this is the Suggestions forum at the bottom
darkgoku
darkgoku
Forumember

Posts : 340
Reputation : 3
Language : English

Back to top Go down

Solved Re: default message

Post by Ramdaman October 18th 2014, 19:11

Try this:

Code:
$(function() {
    if (document.location.href.indexOf('post?f=10&mode=newtopic') > -1) {
      $('#text_editor_textarea').val('CONTENT');
    }
});

Replace "CONTENT" with the content needed. Don't remove the ' ' though.
Ramdaman
Ramdaman
Active Poster

Male Posts : 1615
Reputation : 99
Language : English, Albanian, Macedonian, Russian | HTML, CSS
Location : New York City

http://ndihme.forumotion.com/forum

Back to top Go down

Solved Re: default message

Post by darkgoku October 18th 2014, 19:16

it did not work
darkgoku
darkgoku
Forumember

Posts : 340
Reputation : 3
Language : English

Back to top Go down

Solved Re: default message

Post by Ramdaman October 18th 2014, 19:16

Paste the code with "CONTENT" filled in please.
Ramdaman
Ramdaman
Active Poster

Male Posts : 1615
Reputation : 99
Language : English, Albanian, Macedonian, Russian | HTML, CSS
Location : New York City

http://ndihme.forumotion.com/forum

Back to top Go down

Solved Re: default message

Post by darkgoku October 18th 2014, 19:20

$(function() {
    if (document.location.href.indexOf('post?f=10&mode=newtopic') > -1) {
      $('#text_editor_textarea').val('TestTreest');
    }
});
darkgoku
darkgoku
Forumember

Posts : 340
Reputation : 3
Language : English

Back to top Go down

Solved Re: default message

Post by Ramdaman October 18th 2014, 19:25

You didn't add any content.
Code:
val('');
It's empty.

Try this:
Code:
$(function() {
    if (document.location.href.indexOf('post?f=10&mode=newtopic') > -1) {
      $('#text_editor_textarea').val('[B]Field:[/b] Answer-Here\n
[b]Field2:[/b]Answer-Here\n');
    }
});

I believe "\n" is needed for breaks, otherwise the script won't work well.


Last edited by Ramdaman on October 18th 2014, 19:54; edited 1 time in total
Ramdaman
Ramdaman
Active Poster

Male Posts : 1615
Reputation : 99
Language : English, Albanian, Macedonian, Russian | HTML, CSS
Location : New York City

http://ndihme.forumotion.com/forum

Back to top Go down

Solved Re: default message

Post by Mati October 18th 2014, 19:26

Hello,

You need to have the link for that thread you want the message to show.
Mati
Mati
Hyperactive

Posts : 2020
Reputation : 330
Language : HTML, CSS & JavaScript
Location : Forum Services

https://forumservice.forumotion.com/

Back to top Go down

Solved Re: default message

Post by darkgoku October 18th 2014, 19:28

can u add the link for me then ill add the other stuff
darkgoku
darkgoku
Forumember

Posts : 340
Reputation : 3
Language : English

Back to top Go down

Solved Re: default message

Post by Mati October 18th 2014, 19:30

Tell me in which thread you wanna it.
Mati
Mati
Hyperactive

Posts : 2020
Reputation : 330
Language : HTML, CSS & JavaScript
Location : Forum Services

https://forumservice.forumotion.com/

Back to top Go down

Solved Re: default message

Post by darkgoku October 18th 2014, 19:39

i dont want it in one thread but when someones creates a new thread in suggestions
darkgoku
darkgoku
Forumember

Posts : 340
Reputation : 3
Language : English

Back to top Go down

Solved Re: default message

Post by Mati October 18th 2014, 19:51

Code:
jQuery(function() {
if (document.location.href.indexOf('/post?f=8&mode=newtopic') > -1) {
jQuery('#text_editor_textarea').text('[b]Website Name[/b]:\n[b]Web Address[/b]:\n[b]Language[/b]:\n[b]Description[/b]:');
}
});

In the script you must modify the if statement to the forum you want this to apply to :

Example change the number to your forum suggestions
if (document.location.href.indexOf('/post?f=33&mode=newtopic')

If you don't know how then post your link here
Mati
Mati
Hyperactive

Posts : 2020
Reputation : 330
Language : HTML, CSS & JavaScript
Location : Forum Services

https://forumservice.forumotion.com/

Back to top Go down

Solved Re: default message

Post by Ramdaman October 18th 2014, 19:53

For it to go to the suggestions, it would be this:

Code:
jQuery(function() {
if (document.location.href.indexOf('/post?f=10&mode=newtopic') > -1) {
jQuery('#text_editor_textarea').text('[b]Website Name[/b]:\n[b]Web Address[/b]:\n[b]Language[/b]:\n[b]Description[/b]:');
}
});
Ramdaman
Ramdaman
Active Poster

Male Posts : 1615
Reputation : 99
Language : English, Albanian, Macedonian, Russian | HTML, CSS
Location : New York City

http://ndihme.forumotion.com/forum

Back to top Go down

Solved Re: default message

Post by TheCrow October 18th 2014, 19:55

Mati the forum id is 10. Ramdaman the code does not work.
TheCrow
TheCrow
Manager
Manager

Male Posts : 6897
Reputation : 794
Language : Greek, English

https://forumote.forumotion.com

Back to top Go down

Solved Re: default message

Post by Ramdaman October 18th 2014, 19:57

Hmm, it should work, but maybe it needs optimization for PunBB.

I already placed the correct Forum ID. "/post?f=10"

Is WYSIWYG mode enabled? And do you have any other JavaScripts which might intervene in this script working?
Ramdaman
Ramdaman
Active Poster

Male Posts : 1615
Reputation : 99
Language : English, Albanian, Macedonian, Russian | HTML, CSS
Location : New York City

http://ndihme.forumotion.com/forum

Back to top Go down

Solved Re: default message

Post by TheCrow October 18th 2014, 19:59

The tutorial doesn't say anything about any changes for other versions
TheCrow
TheCrow
Manager
Manager

Male Posts : 6897
Reputation : 794
Language : Greek, English

https://forumote.forumotion.com

Back to top Go down

Solved Re: default message

Post by Ramdaman October 18th 2014, 19:59

Is WYSIWYG mode enabled? And do you have any other JavaScripts which might intervene in this script working?
Ramdaman
Ramdaman
Active Poster

Male Posts : 1615
Reputation : 99
Language : English, Albanian, Macedonian, Russian | HTML, CSS
Location : New York City

http://ndihme.forumotion.com/forum

Back to top Go down

Solved Re: default message

Post by Mati October 18th 2014, 20:00

Only edit the id and it should work simple as that.
Mati
Mati
Hyperactive

Posts : 2020
Reputation : 330
Language : HTML, CSS & JavaScript
Location : Forum Services

https://forumservice.forumotion.com/

Back to top Go down

Solved Re: default message

Post by TheCrow October 18th 2014, 20:03

Mati™️ wrote:Only edit the id and it should work simple as that.  

Unfortunately it doesn't.

Ramdaman wrote:Is WYSIWYG mode enabled? And do you have any other JavaScripts which might intervene in this script working?
No it is not enabled. As for the javascripts i wouldn't have any idea if someone intervene the script. I know almost nothing about javascripts. Confused
TheCrow
TheCrow
Manager
Manager

Male Posts : 6897
Reputation : 794
Language : Greek, English

https://forumote.forumotion.com

Back to top Go down

Solved Re: default message

Post by Ramdaman October 18th 2014, 20:03

I guess we should await Ange Tutuer.
Ramdaman
Ramdaman
Active Poster

Male Posts : 1615
Reputation : 99
Language : English, Albanian, Macedonian, Russian | HTML, CSS
Location : New York City

http://ndihme.forumotion.com/forum

Back to top Go down

Page 1 of 2 1, 2  Next

Back to top


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