HomeHome  
  • WelcomeWelcome  
  • Events  
  • PublicationsPublications  
  • FAQFAQ  
  • SearchSearch  
  • MemberlistMemberlist  
  • UsergroupsUsergroups  
  • RegisterRegister  
  • Log inLog in  
  • You are not connected. Please login or register


    Set default message in a textarea

    avatar
    • Administrator

        Reputation : 315
        Registered on : 2012-02-22
        Posts : 2318
        School of codes courses: coming soon
      Set default message in a textarea


      Description


      Using this resource you will be able to have a default content in a textarea, due to the section you are posting in (only in one, two, etc)  yes 


      Demo



      Code

      You have to reply to this topic to see the code (avoid Flood)


      General Informations

      Code creator: Ange Tuteur
      Code tested on: PhpBB3 - Google Chrome (works even on others)
      Checked by: Ange Tuteur (ESP)
      Extra infos:
      1. In the condition of the if statement is the following
        Code:
        document.location.href.indexOf('/post?f=FORUMID&mode=newtopic') > -1)

        You must change f=FORUMID to the ID of the forum you want this to work in.
        For example, if I wanted to add a form when users create a topic in this forum (http://www.domainname.com/f2-test) I have to use f=2
      2. To add a line break write : \n
        If you're using single quotes write : \'



      Codes last updated on 6th March 2014 - 16:56 by Ange Tuteur



      Niko wants you in the team Guest

      Community manager and Administrator at Forumattivo.com

      avatar
      • Veteran staff member

          Reputation : 2
          Registered on : 2013-08-27
          Posts : 76
          :D
        Wow this look amaizing

        avatar
        • I'm a new member :)


            Reputation : 1
            Registered on : 2014-03-10
            Posts : 7
            Love Fmcodes
          Thanks

          avatar
          • ****


              Reputation : 1
              Registered on : 2013-07-29
              Posts : 56
            good work

            avatar
            • I'm a new member :)


                Reputation : 0
                Registered on : 2014-03-14
                Posts : 7
                Love Fmcodes
              Cool  Cool  Cool

              avatar
              • ***


                  Reputation : 2
                  Registered on : 2014-03-10
                  Posts : 33
                  Love Fmcodes
                awesome , thanks for sharing ..

                avatar
                • I'm a new member :)


                    Reputation : 1
                    Registered on : 2014-04-18
                    Posts : 8
                    Love Fmcodes
                  for example why not using else 
                  so if it's post?f=1&mode=newtopic 
                  give it  $('#text_editor_textarea').val('CONTENT'); 
                  but if forum id where 2 or 3 what ever give 
                  $('#text_editor_textarea').val('this is another thing :)');
                   like this 

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

                  });

                  avatar
                  • *****


                      Reputation : 11
                      Registered on : 2014-04-25
                      Posts : 153
                      Love Fmcodes
                    Thanks, useful :)

                    Edit: how to add more than 1 line? i didnt get it  Confused

                    avatar
                    • ***


                        Reputation : 1
                        Registered on : 2013-11-21
                        Posts : 37
                        LG
                      thank u

                      avatar
                      • ****


                          Reputation : 2
                          Registered on : 2014-05-29
                          Posts : 61
                          Love Fmcodes
                        I'll take this to my advantage on my forum  :bene:

                        avatar
                        • I'm a new member :)


                            Reputation : 0
                            Registered on : 2013-09-24
                            Posts : 4
                            LG
                          nice one Wink

                          avatar
                          • **


                              Reputation : 0
                              Registered on : 2014-06-08
                              Posts : 12
                            thanks

                            avatar
                            • ***


                                Reputation : 0
                                Registered on : 2013-10-23
                                Posts : 34
                                LG
                              thank you
                              Ops the code is not displayed:(

                              avatar
                              • Administrator

                                  Reputation : 315
                                  Registered on : 2012-02-22
                                  Posts : 2318
                                  School of codes courses: coming soon
                                Can't you see the code?



                                Niko wants you in the team Guest

                                Community manager and Administrator at Forumattivo.com

                                avatar
                                • **


                                    Reputation : 1
                                    Registered on : 2012-11-10
                                    Posts : 12
                                  this is helpful for people

                                  avatar
                                  • **


                                      Reputation : 0
                                      Registered on : 2014-11-28
                                      Posts : 17
                                      Love Fmcodes
                                    thanks

                                    avatar
                                    • **


                                        Reputation : 0
                                        Registered on : 2014-12-13
                                        Posts : 23
                                        Love Fmcodes
                                      Useful

                                      avatar
                                      • ***


                                          Reputation : 1
                                          Registered on : 2014-11-17
                                          Posts : 32
                                          Love Fmcodes
                                        good job

                                        avatar
                                        • ***


                                            Reputation : 0
                                            Registered on : 2014-03-01
                                            Posts : 34
                                            LG
                                          good job mans thatk i=you

                                          avatar
                                          • ***


                                              Reputation : 0
                                              Registered on : 2015-08-19
                                              Posts : 29
                                              Love Fmcodes
                                            thanks

                                            avatar
                                            • **


                                                Reputation : 0
                                                Registered on : 2015-04-14
                                                Posts : 23
                                                Love Fmcodes
                                              thanks you

                                              avatar
                                              • **


                                                  Reputation : 1
                                                  Registered on : 2015-01-16
                                                  Posts : 11
                                                  Love Fmcodes
                                                thank

                                                avatar
                                                • **


                                                    Reputation : 0
                                                    Registered on : 2016-07-19
                                                    Posts : 17
                                                  ty ty

                                                  avatar
                                                  • ***


                                                      Reputation : 0
                                                      Registered on : 2017-02-10
                                                      Posts : 38
                                                      Love Fmcodes
                                                    good

                                                    avatar
                                                    • **


                                                        Reputation : 0
                                                        Registered on : 2014-03-21
                                                        Posts : 13
                                                        Love Fmcodes
                                                      i want to see


                                                      YOUR BANNER HERE
                                                      728x90
                                                      DMCA.com Protection Status
                                                      © PunBB | Contact | Report an abuse