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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:57:31+00:00 2026-06-15T02:57:31+00:00

Maybe is a little confusing question but here is an explanation by the code:

  • 0

Maybe is a little confusing question but here is an explanation by the code:

is there a way to do something like this?

$builder->add(
            'doYouWantToEnterData',
            'choice',
            array(
                'choices'   => array(
                    0   => 'no',
                    1   => 'choices_name',
                ),
            ),
          'extend' =>true 
        )
        ->add(
            'choices_name',
            'choice',
            array(
                'choices'   => array(
                    0   => 'text_input_name',
                    1   => 'select_box_name',
                ),
            ),
          'extend' =>true 
        )
        ->add('text_input_name' )
        ->add(
            'select_box_name',
            'choice',
            array(
                'choices'   => array(
                    0   => 'choice_1',
                    1   => 'choice_2',
                ),
            ),
        );

as you can see the choices_name is the option in the option named doYouWantToEnterData and options in the choices_name are text_input_name and select_box_name


is there a way to create this kind of stuff in the FormType class ??

🙂

  • 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-15T02:57:32+00:00Added an answer on June 15, 2026 at 2:57 am

    No. There is no such functionality bundled in the standart form component.
    The best way of doing this is to create custom form type + some JS code to show/hide necessary fields.
    And i suggest you to watch this video (there is an example of similiar problem with choice and optional text).

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

Sidebar

Related Questions

The question maybe a little confusing, but it's hard to make clear this question
OK, that question sounds maybe a little confusing so I'll try to explain it
Maybe the title is a little missleading but I'd like to ask you for
Maybe this sounds a little bit crazy, but I need to come up with
Maybe my question it's a little weird, but I'm trying to build a not-so-simple
I find this question a little tricky. Maybe someone knows an approach to answer
Is it better to evaluate bool once but have more code like this if
Maybe the question title is a little confusing, so I'll try to clarify things
Maybe my question is a little confusing, let me clarify it a little. I'm
My question may be a little confusing, but anyway. My school is going to

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.