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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:50:35+00:00 2026-06-03T23:50:35+00:00

Having this Entity for example: <?php namespace Gitek\HotelBundle\Entity; use Doctrine\ORM\Mapping as ORM; /** *

  • 0

Having this Entity for example:

<?php

namespace Gitek\HotelBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Gitek\HotelBundle\Entity\Product
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="Gitek\HotelBundle\Entity\ProductRepository")
 */
class Product
{
    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string $name
     *
     * @ORM\Column(name="name", type="string", length=100)
     */
    private $name;

How to build a Form to save like 10 products on a row? I want a form with a “+” button and dinamically add line and submit all products in a row.

any help or clue?
thanks in advance

  • 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-03T23:50:36+00:00Added an answer on June 3, 2026 at 11:50 pm

    You could use Javascript(jQuery) to add the form elements to your page dynamically when you click the “Add” button. Something like this:

        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                        "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
        <title></title>
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
    
        <script type="text/javascript">
            $(document).ready(function() {
                $('#btnAdd').click(function() {
                    var num     = $('.clonedInput').length;
                    var newNum  = new Number(num + 1);
    
                    var newElem = $('#input' + num).clone().attr('id', 'input' + newNum);
    
                    newElem.children(':first').attr('id', 'name' + newNum).attr('name', 'name' + newNum);
                    $('#input' + num).after(newElem);
                    $('#btnDel').attr('disabled','');
    
                    if (newNum == 5)
                        $('#btnAdd').attr('disabled','disabled');
                });
    
                $('#btnDel').click(function() {
                    var num = $('.clonedInput').length;
    
                    $('#input' + num).remove();
                    $('#btnAdd').attr('disabled','');
    
                    if (num-1 == 1)
                        $('#btnDel').attr('disabled','disabled');
                });
    
                $('#btnDel').attr('disabled','disabled');
            });
        </script>
    </head>
    
    <body>
    
    <form id="myForm">
        <div id="input1" style="margin-bottom:4px;" class="clonedInput">
            Name: <input type="text" name="name1" id="name1" />
        </div>
    
        <div>
            <input type="button" id="btnAdd" value="add another name" />
            <input type="button" id="btnDel" value="remove name" />
        </div>
    </form>
    
    </body>
    </html>
    

    Reference
    Then when the form is posted, you can walk through the $_POST array.

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

Sidebar

Related Questions

I'm having an entity object called Patient and this entity is having a property
Update: Originally, this post was using Books as the example entity, with Books1 ,
I'm building ASP.NET MVC2 application, and using Entity Framework as ORM. I am having
I'm having trouble understanding how to use ORM generated objects. We're using LLBLGen for
I'm trying to use PHP to process JSON and am having trouble parsing it
I'm having trouble trying to understand how to use recursion with this problem. I'm
Having this code: using (BinaryWriter writer = new BinaryWriter(File.Open(ProjectPath, FileMode.Create))) { //save something here
Having this div: <div id=advSearchDialog style=visibility:hidden;> <xx:search ID=searchUC runat=server /> </div> And a button:
Having this code... var b = new ReadOnlyCollection<int>(new[] { 2, 4, 2, 2 });
Having this line Cursor c = db.rawQuery(PRAGMA table_info(?), new String[] {tableName}); and getting this:

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.