how to use dependency multiple field in admin edit section magento 2.0How to use dependency in multiple dropdown?Dependency in admin form field in magento 2How to edit magento2 footer section?How to add field dependency in admin customer form UI componentMagento 2 Field dependency in ui formMagento 2:Custom Field Value in Edit Products SectionMagento 2 Add new field to Magento_User admin formMagento2: Dependency in admin form fieldEdit price field in configurable product adminMagento 2 Admin Ui form fieldset dependency

Avoiding the "not like other girls" trope?

Unlock My Phone! February 2018

Are there any examples of a variable being normally distributed that is *not* due to the Central Limit Theorem?

Ambiguity in the definition of entropy

CAST throwing error when run in stored procedure but not when run as raw query

One verb to replace 'be a member of' a club

Solving a recurrence relation (poker chips)

Do UK voters know if their MP will be the Speaker of the House?

Expand and Contract

All in one piece, we mend holes in your socks

Examples of smooth manifolds admitting inbetween one and a continuum of complex structures

Can my sorcerer use a spellbook only to collect spells and scribe scrolls, not cast?

How can I deal with my CEO asking me to hire someone with a higher salary than me, a co-founder?

How to prevent "they're falling in love" trope

Why do bosons tend to occupy the same state?

In 'Revenger,' what does 'cove' come from?

Mathematica command that allows it to read my intentions

Is it logically or scientifically possible to artificially send energy to the body?

Can I run a new neutral wire to repair a broken circuit?

Reverse dictionary where values are lists

Intersection Puzzle

How dangerous is XSS?

What's the in-universe reasoning behind sorcerers needing material components?

What is a romance in Latin?



how to use dependency multiple field in admin edit section magento 2.0


How to use dependency in multiple dropdown?Dependency in admin form field in magento 2How to edit magento2 footer section?How to add field dependency in admin customer form UI componentMagento 2 Field dependency in ui formMagento 2:Custom Field Value in Edit Products SectionMagento 2 Add new field to Magento_User admin formMagento2: Dependency in admin form fieldEdit price field in configurable product adminMagento 2 Admin Ui form fieldset dependency













0















my code is in below here how can i set 'gateway_title' and 'gateway_title2'
this tow fields depends on 'gateway_is_active' filed both of those two filed have be depended.



$fieldset->addField(
'gateway_is_active', 'select',
array(
'label' => 'Enable Email Gateway',
'name' => 'gateway[is_active]',
'values' => $options,
'note' => 'Converting new emails that come to a gateway mailbox to tickets'
)
);
$fieldset->addField(
'gateway_title', 'text',
array(
'label' => 'Title',
'name' => 'gateway[title]',
'required' => true,
)
);

$fieldset->addField(
'gateway_title2', 'text',
array(
'label' => 'Title',
'name' => 'gateway[title2]',
'required' => true,
)
);









share|improve this question


























    0















    my code is in below here how can i set 'gateway_title' and 'gateway_title2'
    this tow fields depends on 'gateway_is_active' filed both of those two filed have be depended.



    $fieldset->addField(
    'gateway_is_active', 'select',
    array(
    'label' => 'Enable Email Gateway',
    'name' => 'gateway[is_active]',
    'values' => $options,
    'note' => 'Converting new emails that come to a gateway mailbox to tickets'
    )
    );
    $fieldset->addField(
    'gateway_title', 'text',
    array(
    'label' => 'Title',
    'name' => 'gateway[title]',
    'required' => true,
    )
    );

    $fieldset->addField(
    'gateway_title2', 'text',
    array(
    'label' => 'Title',
    'name' => 'gateway[title2]',
    'required' => true,
    )
    );









    share|improve this question
























      0












      0








      0








      my code is in below here how can i set 'gateway_title' and 'gateway_title2'
      this tow fields depends on 'gateway_is_active' filed both of those two filed have be depended.



      $fieldset->addField(
      'gateway_is_active', 'select',
      array(
      'label' => 'Enable Email Gateway',
      'name' => 'gateway[is_active]',
      'values' => $options,
      'note' => 'Converting new emails that come to a gateway mailbox to tickets'
      )
      );
      $fieldset->addField(
      'gateway_title', 'text',
      array(
      'label' => 'Title',
      'name' => 'gateway[title]',
      'required' => true,
      )
      );

      $fieldset->addField(
      'gateway_title2', 'text',
      array(
      'label' => 'Title',
      'name' => 'gateway[title2]',
      'required' => true,
      )
      );









      share|improve this question














      my code is in below here how can i set 'gateway_title' and 'gateway_title2'
      this tow fields depends on 'gateway_is_active' filed both of those two filed have be depended.



      $fieldset->addField(
      'gateway_is_active', 'select',
      array(
      'label' => 'Enable Email Gateway',
      'name' => 'gateway[is_active]',
      'values' => $options,
      'note' => 'Converting new emails that come to a gateway mailbox to tickets'
      )
      );
      $fieldset->addField(
      'gateway_title', 'text',
      array(
      'label' => 'Title',
      'name' => 'gateway[title]',
      'required' => true,
      )
      );

      $fieldset->addField(
      'gateway_title2', 'text',
      array(
      'label' => 'Title',
      'name' => 'gateway[title2]',
      'required' => true,
      )
      );






      magento2 dependency






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 6 '18 at 11:19









      Shubhajay DasShubhajay Das

      578




      578




















          1 Answer
          1






          active

          oldest

          votes


















          0














          After successfully created basic form .Now you can add following code into Form.php



          $action = $fieldset->addField(
          "main_field",
          "select",
          [
          "label" => __("Main Field"),
          "class" => "required-entry",
          "name" => "main_field",
          "values" => [
          ["value" => 0,"label" => __("Do Nothing")],
          ["value" => 1,"label" => __("Display Field")],
          ]
          ]
          );

          $anotherField = $fieldset->addField(
          "dependent_field",
          "text",
          [
          "label" => __("Dependent Field"),
          "class" => "required-entry",
          "required" => true,
          "name" => "dependent_field"
          ]
          );

          $this->setChild(
          'form_after',
          $this->getLayout()->createBlock('MagentoBackendBlockWidgetFormElementDependence')
          ->addFieldMap($action->getHtmlId(), $action->getName())
          ->addFieldMap($anotherField->getHtmlId(), $anotherField->getName())
          ->addFieldDependence($anotherField->getName(), $action->getName(), 1)
          );


          In first section we create main field select the value of this field display dependent field.Second section create dependent field.In third we define which field display after select main field and also define the value.



          You can check screen-shot.In first screen-shot initial state of form and second screen-shot show dependent field after select main field value.



          enter image description here



          enter image description here



          I hope this blog will help you to create dependent field in your custom form.If you get any issue or query then you can comment below.Thanks



          Source






          share|improve this answer























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "479"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f249191%2fhow-to-use-dependency-multiple-field-in-admin-edit-section-magento-2-0%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            After successfully created basic form .Now you can add following code into Form.php



            $action = $fieldset->addField(
            "main_field",
            "select",
            [
            "label" => __("Main Field"),
            "class" => "required-entry",
            "name" => "main_field",
            "values" => [
            ["value" => 0,"label" => __("Do Nothing")],
            ["value" => 1,"label" => __("Display Field")],
            ]
            ]
            );

            $anotherField = $fieldset->addField(
            "dependent_field",
            "text",
            [
            "label" => __("Dependent Field"),
            "class" => "required-entry",
            "required" => true,
            "name" => "dependent_field"
            ]
            );

            $this->setChild(
            'form_after',
            $this->getLayout()->createBlock('MagentoBackendBlockWidgetFormElementDependence')
            ->addFieldMap($action->getHtmlId(), $action->getName())
            ->addFieldMap($anotherField->getHtmlId(), $anotherField->getName())
            ->addFieldDependence($anotherField->getName(), $action->getName(), 1)
            );


            In first section we create main field select the value of this field display dependent field.Second section create dependent field.In third we define which field display after select main field and also define the value.



            You can check screen-shot.In first screen-shot initial state of form and second screen-shot show dependent field after select main field value.



            enter image description here



            enter image description here



            I hope this blog will help you to create dependent field in your custom form.If you get any issue or query then you can comment below.Thanks



            Source






            share|improve this answer



























              0














              After successfully created basic form .Now you can add following code into Form.php



              $action = $fieldset->addField(
              "main_field",
              "select",
              [
              "label" => __("Main Field"),
              "class" => "required-entry",
              "name" => "main_field",
              "values" => [
              ["value" => 0,"label" => __("Do Nothing")],
              ["value" => 1,"label" => __("Display Field")],
              ]
              ]
              );

              $anotherField = $fieldset->addField(
              "dependent_field",
              "text",
              [
              "label" => __("Dependent Field"),
              "class" => "required-entry",
              "required" => true,
              "name" => "dependent_field"
              ]
              );

              $this->setChild(
              'form_after',
              $this->getLayout()->createBlock('MagentoBackendBlockWidgetFormElementDependence')
              ->addFieldMap($action->getHtmlId(), $action->getName())
              ->addFieldMap($anotherField->getHtmlId(), $anotherField->getName())
              ->addFieldDependence($anotherField->getName(), $action->getName(), 1)
              );


              In first section we create main field select the value of this field display dependent field.Second section create dependent field.In third we define which field display after select main field and also define the value.



              You can check screen-shot.In first screen-shot initial state of form and second screen-shot show dependent field after select main field value.



              enter image description here



              enter image description here



              I hope this blog will help you to create dependent field in your custom form.If you get any issue or query then you can comment below.Thanks



              Source






              share|improve this answer

























                0












                0








                0







                After successfully created basic form .Now you can add following code into Form.php



                $action = $fieldset->addField(
                "main_field",
                "select",
                [
                "label" => __("Main Field"),
                "class" => "required-entry",
                "name" => "main_field",
                "values" => [
                ["value" => 0,"label" => __("Do Nothing")],
                ["value" => 1,"label" => __("Display Field")],
                ]
                ]
                );

                $anotherField = $fieldset->addField(
                "dependent_field",
                "text",
                [
                "label" => __("Dependent Field"),
                "class" => "required-entry",
                "required" => true,
                "name" => "dependent_field"
                ]
                );

                $this->setChild(
                'form_after',
                $this->getLayout()->createBlock('MagentoBackendBlockWidgetFormElementDependence')
                ->addFieldMap($action->getHtmlId(), $action->getName())
                ->addFieldMap($anotherField->getHtmlId(), $anotherField->getName())
                ->addFieldDependence($anotherField->getName(), $action->getName(), 1)
                );


                In first section we create main field select the value of this field display dependent field.Second section create dependent field.In third we define which field display after select main field and also define the value.



                You can check screen-shot.In first screen-shot initial state of form and second screen-shot show dependent field after select main field value.



                enter image description here



                enter image description here



                I hope this blog will help you to create dependent field in your custom form.If you get any issue or query then you can comment below.Thanks



                Source






                share|improve this answer













                After successfully created basic form .Now you can add following code into Form.php



                $action = $fieldset->addField(
                "main_field",
                "select",
                [
                "label" => __("Main Field"),
                "class" => "required-entry",
                "name" => "main_field",
                "values" => [
                ["value" => 0,"label" => __("Do Nothing")],
                ["value" => 1,"label" => __("Display Field")],
                ]
                ]
                );

                $anotherField = $fieldset->addField(
                "dependent_field",
                "text",
                [
                "label" => __("Dependent Field"),
                "class" => "required-entry",
                "required" => true,
                "name" => "dependent_field"
                ]
                );

                $this->setChild(
                'form_after',
                $this->getLayout()->createBlock('MagentoBackendBlockWidgetFormElementDependence')
                ->addFieldMap($action->getHtmlId(), $action->getName())
                ->addFieldMap($anotherField->getHtmlId(), $anotherField->getName())
                ->addFieldDependence($anotherField->getName(), $action->getName(), 1)
                );


                In first section we create main field select the value of this field display dependent field.Second section create dependent field.In third we define which field display after select main field and also define the value.



                You can check screen-shot.In first screen-shot initial state of form and second screen-shot show dependent field after select main field value.



                enter image description here



                enter image description here



                I hope this blog will help you to create dependent field in your custom form.If you get any issue or query then you can comment below.Thanks



                Source







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Feb 13 at 8:10









                mahmoudismailmahmoudismail

                4191426




                4191426



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f249191%2fhow-to-use-dependency-multiple-field-in-admin-edit-section-magento-2-0%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

                    Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                    Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form