0

I made a custom form in drupal. I just want to open that form on popup form when user click on menu.

Here is my code

function acoma_extra_divide_element_horizontaly($form, &$form_state) {
  $form['description'] = array(
    '#type' => 'item',
    '#title' => t('At which height should the element be divided? (distance
    from cupboard floor)'),
  );

  $form['name'] = array(
    '#type' => 'textfield',
    '#title' => t('Divide draw up horizontally'),
    '#suffix' => 'cm',
  );

  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => 'OK',
  );

  return $form;
}

Menu code is:

<div id="step3-menu" class="step3-menu" style="display:none;position: absolute">
        <ul>
            <li><a href="#">Divide element horizontally</a></li>
            <li><a href="#" class="popup">Divide element vertically</a></li>
            <li><a href="#" class="popup">Reset element</a></li>
        </ul>
    </div>

I just want when use click on menu this form loads in popup. I used the popup module.

Any help would be appreciated.

1

There are many ways to do this. You can use Popup forms module. Its configuration is in documentation of module or Modal Frame API module.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.