0

i am using drupal 7

i am trying to add a button within form and successful. now i want to call a function when someone click on that button

here is my code.

function clicktell_form_alter(&$form, &$form_state, $form_id) {
    //print_r($form);

    if($form_id=='user_register_form') {
        $form['add_button'] = array(
            '#type' => 'button',
            '#value' => 'Verifynow',
            '#ajax'> array (
                'callback' => '_udr_ajax_handler',
                'progress' => FALSE,
            ),
        );


    }
}

function _udr_ajax_handler($form, &$form_state) {
    echo "hello "; exit;
}

But this is not working fine. Does anybody tell me how to solve this Thanks

1 Answer 1

1

You missed equal sign '=' near '#ajax'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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