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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:07:57+00:00 2026-05-22T02:07:57+00:00

I can’t seem to get the inputted text of a textarea. When I do

  • 0

I can’t seem to get the inputted text of a textarea. When I do :

die($request->getPostParameter('comment')) 

It outputs the word “array”. When I print_r() it does show the textarea is an array and its value is stored in the array. But I don’t know how to get that value so I can put it into a field in a table.

@greg0ire: I am doing this because I am trying to save data to two different tables. My html page displays a form that is actually made up of two forms from two different classes/models. I have managed to save all fields to both tables except for the comment field. I then tried getting the value and realising it was an array, wondered if this was what was causing my data not to save. This is why I am asking this question. I have asked another question which explains the context.

These are the functions that run on clicking the submit button

   public function executeUpdateInlineForm(sfWebRequest $request)
{

  $overdueInvestigation = Doctrine_Core::getTable('investigation')->find( $request->getParameter('id'));

    $investigationForm = new investigationInlineForm($overdueInvestigation);
    $commentForm=new commentForm();


    $investigationForm->bind($request->getParameter($investigationForm->getName()), $request->getFiles($investigationForm->getName()));
    $commentForm->bind($request->getParameter($commentForm->getName()), $request->getFiles($commentForm->getName()));

    $this->processInlineForm($investigationForm, $commentForm);

  }

protected function processInlineForm(sfForm $investigationForm, sfForm $commentForm)
{

   if ($investigationForm->isValid())
      {
         $investigation = $investigationForm->save();  

         $comment = $commentForm->updateObject();
         $comment->setInvestigation_id($investigationForm->getObject()->getId());
         $comment->setComment($commentForm->getObject()->getComment());
         $comment->setuserId($investigationForm->getObject()->getCreatedUserId());
         $comment->setDateEntered(time());
         $comment->save();
         $this->redirect('investigation/overdue/');
     }


}
  • 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-22T02:07:58+00:00Added an answer on May 22, 2026 at 2:07 am

    you could simply store $request->getPostParameter('comment') in an array and use array_pop() on this array, but I think it would be better to understand why you’re getting an array. I think the name of the textarea must be comment[], when it should probably be just comment.

    UPDATE

    After reading your update and your other question it seems you need to have this naming convention for your fields:

    <input type="text" name="investigation[field1]"/>
    <input type="text" name="investigation[field2]"/>
    <input type="text" name="investigation[field3]"/>
    <input type="text" name="comment[content]"/>
    

    Use the setNameFormat() method on the widget schema of your forms to achieve this, then bind your investigation form to the investigation request parameter, and your comment form to the comment parameter and you will be fine.

    Good luck!

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

Sidebar

Related Questions

Can't seem to get the Back Button to appear in a UINavigationController flow. I
Can somebody tell me how to get mod_rewrite to rename this: our-work-section.php?id=3&title=something to our-work-section/something/3
Can't work out a way to make an array of buttons in android. This
Can i get the source code for a WAMP stack installer somewhere? Any help
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a jquery bug and I've been looking for hours now, I can't
Can anyone give me an example of how to return the following json simply
Can anybody shed some light on getDay() in Javascript please. Here datepicker is textbox
Can PHP PDO extension bind nested objects automatically ? I mean using foreign key
Can I run this in a Windows command prompt like I can run it

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.