I don't want ajax submit / callback validate form '#required' => TRUE, I have form with static fields and dynamic fields as follow:

fieldset


textfield00 (require = true)
textfield01 (require = true)


fieldset


textfield02


fieldset


add textfield
submit button


so, everytime add textfield pressed, it will add new/duplicate textfield02.

with add textfield code as follow:

$form['fields']['modules']['add'] = array(
      '#type' =&gt; 'submit',
      '#name' =&gt; 'addtextfield',
      '#value' =&gt; t('Add more TextField'),
      '#submit' =&gt; array(array($this, 'addTextfieldSubmit')),
      '#ajax' =&gt; array(
        'callback' =&gt; array($this, 'addTextFieldCallback'),
        'wrapper' =&gt; 'wrapper',
        'effect' =&gt; 'fade',
      ),
    );


the adding field is working fine, the only problem i have here is: because textfield00 and textfield01 is mandatory, if i pressed add button, it will send me an error message 'mandatory fields' before i can add new textfield.

so how can i 'bypass' the requried validation, everytime i press add textfiled and only validate 'required = true' when i press submit button.

Thank You,
AnD
'#limit_validation_errors' => array();

$form['actions']['previous'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; t('Previous'),
    '#limit_validation_errors' =&gt; array(
      // Validate $form_state-&gt;getValue('step1').
      array('step1'),
      // Validate $form_state-&gt;getValue(array('foo', 'bar')).
      array('foo', 'bar'),
    ),
    '#submit' =&gt; array('some_submit_function'), // #submit required.
  );