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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:25:56+00:00 2026-06-15T05:25:56+00:00

Im not sure if im doing this right: <div> <form id=formPost method=post> <div id=testdiv>

  • 0

Im not sure if im doing this right:

 <div>
    <form id="formPost" method="post">

    <div id="testdiv">
    </div>

    </form>
 </div>
 <div class="actions-left">
    <div id="textarea">
      <a href="javascript:ShowReplyTextArea();" class="button">Reply</a>
    </div>  
    <div id="postButton">
      <a href="javascript:ReplyPost(<%: Model.News.NewsId %>);" class="button">Post</a>
    </div>
    <div class="clear"></div>
  </div>

 <script type="text/javascript">

 $(document).ready(function() {
   $("#postButton").hide();
 });

 function ShowReplyTextArea() {
   div = document.getElementById("testdiv")
   var textArea = document.createElement("textarea");
   textArea.rows = 10;
   textArea.cols = 10;
   textArea.id = "post_textarea";

   div.appendChild(textArea);

   if ($("#post_textarea").val() != null)
     $("#postButton").show();
 }

 function ReplyPost(newsId)
 {
   div = document.getElementById("testdiv")
   var textArea = document.createElement("textarea");
   div.appendChild(textArea);
   textArea.id = "reply_textarea";
   textArea.value = this.valueOf();;
   **var message = textArea.value.toString(); //problem here dont know how???
   alert(message);
   var jqxhr = $.getJSON("<%= Url.Action("ReplyPost", "Home", new { area = "News" }) %>?newsId=" + newsId + "&message=" + message, function (data) {**
   });
 }
</script>

then in my controller:

[HttpGet]
[NoCache]
public JsonResult ReplyPost(int newsId, string message)
{
  ZincService.NewsService.ReplyPost(newsId, message);
  return Json(new { success = true }, JsonRequestBehavior.AllowGet);
}

herewith the source:

  <div>
    <form id="formPost" method="post">

    <div id="testdiv">
    </div>

    </form>
  </div>
  <div class="actions-left">
    <div id="textarea">
      <a href="javascript:ShowReplyTextArea();" class="button">Reply</a>
    </div>  
    <div id="postButton">
      <a href="javascript:ReplyPost(116);" class="button">Post</a>
    </div>
    <div class="clear"></div>
  </div>

how do i get the value of the text area so i can pass it on, the code i have there now is not correct, am i doing all of this correct?? i see no text area with my text i typed “sdfgsdfg”

thanks

  • 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-15T05:25:57+00:00Added an answer on June 15, 2026 at 5:25 am

    Just use :

    var message = textArea.innerHTML;
    

    Or

    var message = textArea.innerText;
    

    Or

    var message = $(textArea).html();
    

    Or

    var message = $(textArea).text();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im not sure if I'm doing this right. I have an action that I
Not too sure if I'm doing this right. It looks a bit more convoluted
am not sure if I'm doing this right, but I'm trying to create a
I am not sure if I am doing this right. I am trying to
I'm not sure I'm doing this the right way, so I'm open to other
2 Questions really, and I'm not sure if I'm doing this right or not...
Not sure if I am doing this correctly or not. Here is my .js
I'm not sure whether or not this is the appropriate way of doing this,
I'm just not too sure the proper way of doing this. I basically have
I know this probably really simple but Im not sure what im doing wrong...

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.