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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:36:34+00:00 2026-06-11T10:36:34+00:00

I need to create some forms non-linked to entities. I pretty understood how create

  • 0

I need to create some forms non-linked to entities.
I pretty understood how create my builders, but when I try to use them, I am pretty confuse, and I don’t really find examples in the online doc of Symfony 2.0

To go into the details: I create a “Multiple choice question” form. So I created:

  • a “class ResponseType extends AbstractType”
  • a “class MCQType extends AbstractType”, which uses my class ResponseType
  • a file “forms.html.twig”, which includes templates for my “responsetype_widget” and for my “mcqtype_widget”

My aim is to be able to customize the labels and play with them in this template (like add div with uniqueID, etc), specially the itemization when I add a new item: I would know how to change the “0”, “1”, “2”, etc in “Bad answer 1”, “Bad answer 2”, etc.
Currently, I do it with JQuery, in the client-side. But when I submit my form, and an error appears, my created items appear with the “0”, “1” ; generated by the server-side.

Here are screenshot to have a better view of the situation:

  • Modified by JQuery (sorry not enought reputation to post images)
  • Generated by Symfony 2

I really would customize these labels on the server-side, or in my “class MCQType extends AbstractType”, or from the mcqtype_widget in forms.html.twig

I tried a lot of stuff that I found in the doc, but nothing works and I feel desesperate to mofify that from the JS instead of the server-side.
Is somebody have a good example?

Thank you by advance. And if any good tutorial is realeased about manipulate collections, I would really help me!

  • 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-11T10:36:36+00:00Added an answer on June 11, 2026 at 10:36 am

    What you need to do for customizing those labels is to redefine the template block to include your modification.

    To do so, you’ll need this part of the documentation :
    http://symfony.com/doc/2.0/cookbook/form/form_customization.html

    I would also advise you to play with that in order to get familiar with the form collection :
    http://bootstrap.mohrenweiserpartner.de/mopa/bootstrap/forms/collections

    Don’t hesitate to go deep inside to see how they are doing.

    PS: if you need to hide those labels, you need to pass 'show_legend' => false, inside the field options

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

Sidebar

Related Questions

I need to create some dynamic menus in a VS2010 SDI application I'm writing.
I need to create some mini-windows, like the ones shown in the image bellow,
I need to create some xaml that shows text in columns like newspaper, something
I need to create some simple effects for the layers which I have created
I need to create some base exception classes and inherit from it. I see
Into a class constructor, I need to create some objects on the fly and
i have a problem with my mvc3 application, i need to create some Validation
I need to create one drop down list contains some Languages. By selecting any
I have some data and need to create a json file with this structure
I need to create a DIV that has some content (some of which is

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.