Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6052377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:55:19+00:00 2026-05-23T07:55:19+00:00

I have many text area in one page I get them by a link

  • 0

I have many text area in one page I get them by a link called “comment” so her is the idea I made a code in php that includes a form when the user clicks on “comment” this is an Ex.

if(isset($_GET[‘comments’])) { $comments = $_GET[‘comments’];
}
if (!isset($_GET[‘comments’])) {
$comments = “”;
}
if ($comments == “ok”) {

                      echo "<tr><td colspan='6' align='center'>";
                      echo "<span class='rePost'>Re : &nbsp;</span><span

class=’blogerName’>$blog->ByName”;
include “postComments.php”; echo
“”;

                     } ?>

now when the user clicks on comment it just includes the comment text area
but here there is more then one threads on the same page or I can say more then one post on the same page so when the user clicks on “comment” on post one all the other posts get the text area below it.
what I need here is when the user clicks comment on post “1” the text area appear below post “1” and not 2 or 3 or any other one on this page.
I hope I got you to the point that I want.

I think it can be do by java or if anybody have a other idea please post it to me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T07:55:20+00:00Added an answer on May 23, 2026 at 7:55 am

    What you want is best implemented by means of JavaScript as I think you meant when you said “Java”. As the commenters have pointed out the two are not related.

    Basically there is two ways you could approach this.

    You could:

    a) put out all of your TextAreas along with the page at all times but give them a css class with display:none. Each of the TextAreas or its surrounding container that you set to be invisible this way needs to have a unique id, too.

    Then you can use a javascript function to assign another class that does not have the display:none property to any single id.

    b) put out empty elements where the text areas are supposed to go later but also with a unique id. You’d then load HTML when it’s needed by means of Javascript (AJAX). This is only a good choice if there are many possible elements and putting all of them out at all times blows up your page too much.

    Does the site use any JS framework like jQuery? Anyway this might get you started in implementing option a above:

    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
        <head>
            <meta charset="utf-8"/>
            <style type="text/css">
            /*<![CDATA[*/ 
                .hidden
                {
                    display:none;
                }
            /*]]>*/
            </style>
            <script type="text/javascript">
            // <![CDATA[
            function hasClass(ele,cls) {
                return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));
            }
    
            function addClass(ele,cls) {
                if (!this.hasClass(ele,cls)) ele.className += " "+cls;
            }
    
            function removeClass(ele,cls) {
                if (hasClass(ele,cls)) {
                    var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)');
                    ele.className=ele.className.replace(reg,' ');
                }
            }
    
            function showComment(id){
                var hideID=document.getElementById('c0');
                var i=0;
                while (hideID!=null)
                {
                    addClass(hideID,'hidden');
                    i++;
                    hideID=document.getElementById('c'+i);
                }
    
                removeClass(document.getElementById(id),'hidden');
            }
            // ]]>
            </script>
        </head>
        <body>
        <a href="javascript:showComment('c0');">show 1</a> 
        <a href="javascript:showComment('c1');">show 2</a> 
        <a href="javascript:showComment('c2');">show 3</a>
        <div id="c0" class="hidden">
            <textarea rows="4" cols="98">txt1</textarea></div>
        <div id="c1" class="hidden">
            <textarea rows="4" cols="98">txt2</textarea></div>
        <div id="c2" class="hidden">
            <textarea rows="4" cols="98">txt3</textarea></div>
    </body></html>
    

    This does rely on the ids of the elemets we are showing/hiding to be c0 through cN with N being the count of elements to show/hide minus one…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have many text files, their total size is about 300GB ~ 400GB. They
Kind of like this question I have many text snippets that I use many,
I want to translate text in Indian languages. I have gone through many articles
I have a few text files and I'd like to count how many times
Like many, I have spreadsheet that draws data from over 40 text files as
I have a source of strings (let us say, a text file) and many
I have MANY small Test Projects where I put together just enough code to
I have many links in my page. For example <a href=/promotions/download/schools/australia.aspx>Australia</a> Now I want
Projects have many tasks and a task has a custom RESTful action called 'approve'.
I want to get the caret position inside text area (Internet Explorer only). I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.