Skip to content

Instantly share code, notes, and snippets.

@alnutile
Created November 22, 2013 16:37
Show Gist options
  • Save alnutile/7602857 to your computer and use it in GitHub Desktop.
Save alnutile/7602857 to your computer and use it in GitHub Desktop.
// Then the "answer" field should contain "8.9"
$form['questions']['should_see_value']['form_field_css'] = array(
'#type' => 'textfield',
'#title' => t('Then the'),
'#name' => 'form_field_css',
'#attributes' => array(
'class' => array('col-mg-12', 'should_see_value_group'),
'data-type' => array('textfield'),
'placeholder' => t('the name|id|label of the field'),
),
);
$form['questions']['should_see_value']['form_field_should_should_not_contain'] = array(
'#type' => 'select',
'#name' => 'form_field_should_should_not_contain',
'#prefix' => '<div class="qualifier">',
'#suffix' => '</div>',
'#description' => t('Should the value be there or not?'),
'#options' => array('field should contain' => t('field should contain'), 'field should not contain' => t('field should not contain')),
'#validated' => TRUE,
'#attributes' => array(
'class' => array('col-mg-12', 'should_see_value_group'),
'data-type' => array('select'),
),
);
$form['questions']['should_see_value']['form_field_value'] = array(
'#type' => 'textfield',
'#name' => 'form_field_value',
'#attributes' => array(
'class' => array('col-mg-12', 'should_see_value_group'),
'data-type' => array('textfield'),
'placeholder' => t('The value that should be in the field'),
),
);
$form['questions']['should_see_value']['form_field_button'] = array(
'#type' => 'button',
'#name' => 'form_field_button',
'#value' => t('Add'),
'#attributes' => array(
'data-step-group' => array('should_see_value_group'),
'data-method' => array('append'),
'class' => array('steps')
),
'#suffix' => '<hr>'
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment