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 8077883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:37:05+00:00 2026-06-05T15:37:05+00:00

<div id=post> <form name=postComment id=commentPost6 action=javascript:void(0); method=post target=_top onsubmit=return commentPost(6)> <textarea name=comment id=comment6 class=commentText

  • 0
<div id="post">
  <form name="postComment" id="commentPost6" action="javascript:void(0);" method="post"
    target="_top" onsubmit="return commentPost(6)">
     <textarea name="comment" id="comment6" class="commentText" 
        cols="10" rows="3" accesskey="1">
     </textarea><br>
     <input type="submit" name="submit" id="commentpost" value="Submit" accesskey="2">
  </form>
</div>

this is my post div tag, i have multiple div tag with same id=”post”,
the form and fields are dynamically generated and id of both form and textarea are unique, so that there is no problem in retriving those values, on click of submit, i call commentPost method.

function commentPost(postId)
{
    alert("Inside commentpost");
    //how to retrive/access value of textarea here

}

how to get value of textarea ??
and just in case

Yes, i know it’s not valid HTML to have multiple elements with the same ID.

  • 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-06-05T15:37:09+00:00Added an answer on June 5, 2026 at 3:37 pm
    $('#comment'+postId).val();
    

    Why aren’t you simply using classes instead of ids? (post)

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

Sidebar

Related Questions

<body> <div> <?= $_POST['msg'] ?> </div> <form id=frm method=post> <input type=hidden name='msg' value='{field0: Im
Form (partial): include ../mixins/form-helpers form(action='/users/create', method='post') div.fields fieldset mixin field('text', 'email', 'Email') mixin field('password',
html structure: <form method=post id=comment-form accept-charset=UTF-8> <div class=form-item form-type-textfield form-item-name> <input type=text id=edit-name name=name
<form method=post action=sendmail.php name=Email_form> Message ID <input type=text name=message_id /><br/><br/> Aggressive conduct <input type=radio
I have a page with a form like so: <form method=POST action=scripts/save-settings2.php> <div id=posts>
I have code similar to the below <form action=/u method=post> <div class=reply> <input type=hidden
if(!isset($_POST['JoinFaction'])) { echo '<form method=post action='.$page_name.'><dl id=sample class=dropdown align=left>' .'<dt><a href=#><span>Recruiting Factions ['.$numrows.']</span>' .'</a></dt><dd><ul>';
I have the code: <div class='selectAnAction'> <ul> <li class='actionSelect'><span>Select an Action</span></li> <li class='action' onclick='location.href=\/post.php?key=.$row['hash'].\;'>post</li>
I have multiple div tag's of post name in my page, what I want
$.post('includes/script.php', $(this).serialize(), function(data) { $('body').append(data); }); alert ($('#new').length) php script is <php echo <div

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.