SitePoint Sponsor

User Tag List

Results 1 to 14 of 14
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2007
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to display a message in the text bar

    I'm newbie in programming but I want to display a message in a text bar like Facebook post bar whereby a user gets a msg eg ' what are you doing now'.
    Therefore a user write something in that textbox?
    www.palsnaija.com

    social site to share video's,Photo's & blogs

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Evening gpo

    OK what you are looking at is a form with a textarea that submits to the database. The process then uses AJAX to immediately display the new status on the page.

    Which site is it for?
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  3. #3
    SitePoint Enthusiast
    Join Date
    Nov 2007
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by spikeZ View Post
    Evening gpo

    OK what you are looking at is a form with a textarea that submits to the database. The process then uses AJAX to immediately display the new status on the page.

    Which site is it for?
    A new social site am testing using elgg platform...
    Like in facebook the home page you see a message box or textbox with a display message like 'what are you doing at the momment' then the user type in that textbox anything which then posted.
    I've got a message box widget ,but the text area is blank,but i want to put a display like 'write something' in the blank text area.
    Any ideas?
    www.palsnaija.com

    social site to share video's,Photo's & blogs

  4. #4
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    in your code there will be some code like:

    Code:
    <textarea name="somethin"></textarea>
    replace that with

    Code:
    <textarea name="somethin" onfocus="clearDefault(this)">What are you doing?</textarea>
    then you can add the following javacript

    Code:
    <script>
    function clearDefault(el) {
      if (el.defaultValue==el.value) el.value = ""
    }
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  5. #5
    SitePoint Enthusiast
    Join Date
    Nov 2007
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks I'd try it..
    www.palsnaija.com

    social site to share video's,Photo's & blogs

  6. #6
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    done it yet?!!!
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  7. #7
    SitePoint Enthusiast
    Join Date
    Nov 2007
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also ,where do get free good icons?
    www.palsnaija.com

    social site to share video's,Photo's & blogs

  8. #8
    SitePoint Enthusiast
    Join Date
    Nov 2007
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by spikeZ View Post
    done it yet?!!!
    I've tried but no joy...maybe you could check the code?
    www.palsnaija.com

    social site to share video's,Photo's & blogs

  9. #9
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    PM me the details gof
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  10. #10
    SitePoint Enthusiast
    Join Date
    Nov 2007
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here are the files...messageboard & status.
    I just want display message on textarea :'what are you doing now?'
    Attached Files Attached Files
    www.palsnaija.com

    social site to share video's,Photo's & blogs

  11. #11
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Morning Gof,

    Change the file:
    messageboard > views > default > messageboard > forms > add.php

    to:

    PHP Code:
    <?php

        
    /**
         * Elgg Message board add form
         * 
         * @package ElggMessageBoard
         * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
         * @author Curverider Ltd <info@elgg.com>
         * @copyright Curverider Ltd 2008
         * @link http://elgg.com/
         */
         
    ?>
    <script>
    function clearDefault(el) {
      if (el.defaultValue==el.value) el.value = ""
    }
    </script>
    <div id="mb_input_wrapper">
    <form action="<?php echo $vars['url']; ?>action/messageboard/add" method="post" name="messageboardForm">
       
        <!-- textarea for the contents -->
        <textarea name="message_content" class="input_textarea" onfocus="clearDefault(this)" />What are you doing now?</textarea><br />
       
        <!-- the person posting an item on the message board -->
        <input type="hidden" name="guid" value="<?php echo $_SESSION['guid']; ?>"  />
       
        <!-- the page owner, this will be the profile owner -->
        <input type="hidden" name="pageOwner" value="<?php echo page_owner(); ?>"  />
       
        <!-- submit messages input -->
        <input type="submit" id="postit" value="<?php echo elgg_echo('messageboard:postit'); ?>">
        
    </form>
    </div>
    and see what happens.

    Off Topic:


    Hows Yaser?
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  12. #12
    SitePoint Enthusiast
    Join Date
    Nov 2007
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by spikeZ View Post
    Morning Gof,

    Change the file:
    messageboard > views > default > messageboard > forms > add.php

    to:

    PHP Code:
    <?php

        
    /**
         * Elgg Message board add form
         * 
         * @package ElggMessageBoard
         * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
         * @author Curverider Ltd <info@elgg.com>
         * @copyright Curverider Ltd 2008
         * @link http://elgg.com/
         */
         
    ?>
    <script>
    function clearDefault(el) {
      if (el.defaultValue==el.value) el.value = ""
    }
    </script>
    <div id="mb_input_wrapper">
    <form action="<?php echo $vars['url']; ?>action/messageboard/add" method="post" name="messageboardForm">
       
        <!-- textarea for the contents -->
        <textarea name="message_content" class="input_textarea" onfocus="clearDefault(this)" />What are you doing now?</textarea><br />
       
        <!-- the person posting an item on the message board -->
        <input type="hidden" name="guid" value="<?php echo $_SESSION['guid']; ?>"  />
       
        <!-- the page owner, this will be the profile owner -->
        <input type="hidden" name="pageOwner" value="<?php echo page_owner(); ?>"  />
       
        <!-- submit messages input -->
        <input type="submit" id="postit" value="<?php echo elgg_echo('messageboard:postit'); ?>">
        
    </form>
    </div>
    and see what happens.

    Off Topic:


    Hows Yaser?
    Thanks for your quick reply!!
    His on holiday and I've been up & down Wales for a week!!
    www.palsnaija.com

    social site to share video's,Photo's & blogs

  13. #13
    SitePoint Enthusiast
    Join Date
    Nov 2007
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It worked ..Big thanks...
    www.palsnaija.com

    social site to share video's,Photo's & blogs

  14. #14
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Glad it worked and Wales in October - nice
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •