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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:23:51+00:00 2026-05-31T10:23:51+00:00

I have a Symfony 1.4 application to allow users to enter data to a

  • 0

I have a Symfony 1.4 application to allow users to enter data to a electrical appliance testing database. The page in questions consists of multiple embedded “new” forms so the user can submit many tests in one go. The form validates and saves correctly, but feedback is that it will be tedious to use.

As much of the data may be the same in each test (e.g. same date, same result, same person doing the testing), I would like the user to be able to fill in values in the top row, then click a button to fill the same information in the rows below. I’m pretty sure this would require javascript, but I don’t have much experience.

I would appreciate any suggestions.

Many 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-05-31T10:23:54+00:00Added an answer on May 31, 2026 at 10:23 am

    Well, I managed to figure it out without using javascript.

    I put a button on the page

    <input type="submit" name="copy_values" value="duplicate">
    

    In the action for the page I included the code…

     elseif (isset($_POST['copy_values'])) {
       // get values from first embedded test
       $newTests = $testList['new_tests'];
       $testDate = $newTests[0]['et_date_tested'];
       $testedBy = $newTests[0]['et_tester_id'];
       $formOptions = array('test_date'=>$testDate, 'tester'=>$testedBy);
       $this->form = new MultiTestForm(null, $formOptions);
     }
     $this->setTemplate('multiAdd');
    

    … which takes the values from the widgets in the top row of the form and creates an array. This is passed as the options array to create a new form.

    In the top level form class..

    public function configure()
    {
      ...
      $subform = new sfForm();
      for($i = 0;$i < sfConfig::get('app_new_test_rows'); $i ++) 
      {
        $formToAdd = new TestsForMultiAddForm(null,$this->getOptions());
        $subform->embedForm($i, $formToAdd);
      }
    
      $this->embedForm('new_tests', $subform);
    }
    

    …and in the embedded form class…

     public function configure() 
    {
       ...
       if ($this->getOption('test_date'))  {
         $this->setDefault('et_date_tested', $this->getOption('test_date'));
       }
       if ($this->getOption('tester')) {
         $this->setDefault('et_tester_id', $this->getOption('tester'));
       }
        ...
     }
    

    Not sure if this is the conventional way to approach the problem, but it works!

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

Sidebar

Related Questions

I have a Symfony application which use a mysql database to store session data,
I'm constructing an ecommerce application in Symfony, and I have a page which lists
Problem: I have a symfony project with a database full of production data I
I have written my yaml schema for the database for my Symfony+doctrine application, and
Let's say you have a situation where your Symfony application cannot get its database
I have a symfony application (version 1.4). I want to see index page of
I have a Symfony 1.2.4 application, taken and modified from the Symfony sandbox application
I have an application that I'm converting to Symfony/Doctrine. It currently stores a serialized
I have a Symfony app that populates the widgets of a portal application and
I have the following routes configuration in a Symfony application: label: url: /label param:

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.