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.
The forum of the forums
3 posters

    Text area and Save Button

    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

    Solved Text area and Save Button

    Post by TheCrow April 6th 2015, 2:02 pm

    Technical Details


    Forum version : phpBB3
    Position : Founder
    Concerned browser(s) : Google Chrome
    Who the problem concerns : Yourself
    Forum link : http://helpgr.forumgreek.com/

    Description of problem

    Hello,

    I would like to know how to design a text area where whoever has access to that page can edit the text area and save the text.

    For example,
    This is the text area



    and a save button below that.
    I want if i want to change it, the text to stay the same and simply add information below and when i click save to simply save the updates.

    Something like the block in the admin panel but have the editor style.

    Could someone help me on this please?

    Thanks,
    Luffy
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: Text area and Save Button

    Post by Van-Helsing April 6th 2015, 3:11 pm

    Hello @Luffy Smile ,
    Do you want to auto-save the contents of the text area of a post?
    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

    Solved Re: Text area and Save Button

    Post by TheCrow April 6th 2015, 3:20 pm

    Hello @Black-Shadow,

    No this will be in a html page and i want it to save the content of the text area if you leave the window. I am doing some tests and i don't get what i want.

    Luffy



    Text area and Save Button Thecro10
     Forum of the Forums

    Forumotion Rules | Tips & Tricks |
    FAQ | Did you forget your password?



    *** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
    No support via PM!
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: Text area and Save Button

    Post by Van-Helsing April 6th 2015, 3:31 pm

    Have you try this tutorial? I have tested and when accidentally leave the post/page when I am return back to the forum and I am pressing New Post it is restoring the data back.
    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

    Solved Re: Text area and Save Button

    Post by TheCrow April 6th 2015, 3:34 pm

    This is not a post i want this. This is a html page i want to add this.. There is no place to post something. It's just a text area as the profile fields that are editable and then by clicking save it should save the content.



    Text area and Save Button Thecro10
     Forum of the Forums

    Forumotion Rules | Tips & Tricks |
    FAQ | Did you forget your password?



    *** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
    No support via PM!
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: Text area and Save Button

    Post by Van-Helsing April 6th 2015, 3:46 pm

    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

    Solved Re: Text area and Save Button

    Post by TheCrow April 6th 2015, 8:27 pm

    Doesn't Seem to work. @Ange Tuteur could you please tell me what i can do?

    I figured to do this but it doesn't save anything:
    Code:
     <div id="notesFg" class="mods_main" style="display:none">
                <h2>Σημειώσεις Διαχείρισης</h2>
                      <blockquote class="block_left">
                        <p class="explain">Οι σημειώσεις διαχείρισης είναι για να σημειώνετε ότι πιστεύετε ότι είναι απαραίτητο για τους υπόλοιπους συντονιστές/διαχειριστές.</p>
                      </blockquote>
                        <fieldset class="notepad-pa">
                          <legend class="field_title">Σημειωματάριο Διαχείρισης</legend>
                          <form method="post" name="post" action="">
                         
                               
                            <center><u><strong><center>Εδώ σημειώνετε ότι θέλετε να δουν οι υπόλοιποι γράφοντας πάντα στην αρχή το όνομά σας!
                              </center></strong></u>
                                           
                              <div class="field_editable" style="margin-top:5px;"><textarea class="inputbox" id="profile_field_2_5" name="profile_field_2_5" rows="12" cols="50"></textarea><img src="http://i.imgur.com/oNIG52p.png" class="ajax-profil_valid" alt="Επικύρωση" title="Επικύρωση" style="margin-top:5px;" /></div>
                          </center> 
                            </form>
                      </fieldset>
                   
                    </div>

    Luffy



    Text area and Save Button Thecro10
     Forum of the Forums

    Forumotion Rules | Tips & Tricks |
    FAQ | Did you forget your password?



    *** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
    No support via PM!
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Text area and Save Button

    Post by Ange Tuteur April 7th 2015, 5:31 am

    Here's an example I can give you. Go to Administration Panel > Modules > HTML pages management

    Use your forum header : Yes
    Paste the following code :
    Code:
    <h1 class="page-title">Notepad</h1>
    <textarea class="inputbox" id="note-text" style="height:250px;width:99%;"></textarea>
    <div style="text-align:center;margin:3px 0">
      <input id="note-save" class="button1" type="button" value="Save"/> <input id="note-reset" class="button1" type="button" value="Reset"/>
    </div>

    <script type="text/javascript">//<![CDATA[
    (function() {
      var post = 6,
          text = '', area = getId('note-text'), save = getId('note-save'), reset = getId('note-reset'); 
     
      $.get('/post?p='+post+'&mode=editpost', function(d) {
        text = $('#text_editor_textarea',d)[0].value;
        area.value = text;
      });
     
      reset.onclick = function() {
        var c = confirm('Are you sure you want to reset the notepad ?');
        if (c) area.value = text;
      };
     
      save.onclick = function() {
        save.style.opacity = 0.3;
        $.post('/post?p='+post+'&mode=editpost', {
          subject : 'Notepad',
          message : area.value,
          post : 1
        },function() {
          text = area.value;
          save.style.opacity = 1;
        });
      };
     
      function getId(i) { return document.getElementById(i) };
    })();
    //]]></script>

    Now make a topic where you allow the members you want to moderate. Once it's posted, click the edit button and copy the ID from the URL. /post?p=951443&mode=editpost

    Now in the HTML above, replace the 6 in var post = 6, with the ID you copied. One other thing you need to make sure is that the following option is disabled :
    Administration Panel > General > Security > Unauthorize unofficial forms to post messages and private messages on the forum : NO
    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

    Solved Re: Text area and Save Button

    Post by TheCrow April 7th 2015, 9:59 am

    Hello @Ange Tuteur,

    Yes now it's solved and works perfectly!

    Thanks,
    Luffy



    Text area and Save Button Thecro10
     Forum of the Forums

    Forumotion Rules | Tips & Tricks |
    FAQ | Did you forget your password?



    *** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
    No support via PM!
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Text area and Save Button

    Post by Ange Tuteur April 7th 2015, 10:02 pm

    No problem. Wink

    Topic archived

      Current date/time is November 11th 2024, 6:14 pm