How to access form elements in table via getValue()?

I'm trying to do so using array indices. Say, we have

$form['mytable'] = array( '#type' => 'table', '#header' => array(t('a'), t('b')));  $form['mytable'][1]['a'] = array( '#type' => 'textfield', '#required' => true));  $form['mytable'][1]['b'] = array( '#type' => 'textfield', '#required' => true)); 

What am I doing: $form_state->getValue('mytable[1][b]');, and it's not working. And how to pass such a field to setErrorByName?


Category: forms Time: 2016-07-29 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.180 (s). 12 q(s)