ajax关键字在drupal中从数据库中搜索

时间:2016-11-10 11:27:28

标签: jquery ajax search drupal-7 keyword

这是我拥有的ajax搜索代码:     

function mymodule_menu() {
    $items = array();
    $items['ajaxsearch'] = array(
             'title' => 'Search Through ajax', //page title
            'description' => 'A form to mess around with.',
            'page callback' => 'drupal_get_form',
            'page arguments' => array('ajaxsearch_form'),
            'access arguments' => array(''),
            'access callback' => TRUE,
            'type' => MENU_CALLBACK
    );


    return $items;
}
function ajaxsearch_form($form, &$form_state) {
    $form = array();

    $form['search'] = array(
            '#title' => t('search the name'),
            '#type' => 'textfield',

    );


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

    return $form;
}

function ajaxsearch_form_submit($form,&$form_state){

}


?>

当我在文本框中输入d时,请向我发送drupal数据库中ajax搜索数据的代码..这将显示与数据库中的k相关的数据帮助我。

0 个答案:

没有答案