上海戴文 - Drupal开发专家

你在这里

请教下ajax生成的怎么取值

主标签

drupal 8的话题呐   may you can try devel module and use the command "dpm($form);"

扫一扫关注Drupal社区公众号LoveDrupal

qrcode_for_gh_037d374f7de5_258.jpg

用了dpm($form_state);后有显示ajax生成的表单信息,

'etl_format_check' => array(3)
    'erj_name' => array(3)

        '#type' => string(9) "textfield"

        '#title' => string UTF-8(2) "表名"

        '#value' => string(3) "erw"
   
    'fields_type_0' => array(3)

        '#type' => string(6) "select"

        '#title' => string UTF-8(4) "字符类型"
        '#options' => array(3)

            string UTF-8(3) "字符串"

            string UTF-8(2) "数值"

            string UTF-8(2) "日期"

 

然后我用$form_state->getValue(array('etl_format_check','erj_name'),'m');取值确定取不到值:)?