$(form).ajaxSubmit is not a function

前端 未结 7 1826
猫巷女王i
猫巷女王i 2020-12-02 18:23

I\'m trying to use the jquery validate plugin to validate a form and submit the contents with an ajax request.

This code is in the head of my document.



        
7条回答
  •  我在风中等你
    2020-12-02 19:06

    Drupal 8

    Drupal 8 does not include JS-libraries to pages automaticly. So most probably if you meet this error you need to attach 'core/jquery.form' library to your page (or form). Add something like this to your render array:

    $form['#attached']['library'][] = 'core/jquery.form';
    

提交回复
热议问题