I did some manipulation (with JavaScript and CSS) on my comment form. It works good. Then I needed to install the Ajax Comments module because I don't want visitors to go another page while replying a comment.
My customization on the comment form doesn't work after enabling the Ajax Comments module.
This is the custom code that works without Ajax Comments:
function mytheme_form_alter(&$form, &$form_state, $form_id) {
if($form_id == 'comment_node_blog_form') {
$form['comment_body']['#weight'] = -100;
$form['#attached']['js'][] = drupal_get_path('theme', 'mytheme') . '/js/jquery.validationEngine-en.js';
$form['#attached']['js'][] = drupal_get_path('theme', 'mytheme') . '/js/jquery.validationEngine.js';
$form['#attached']['js'][] = drupal_get_path('theme', 'mytheme') . '/js/scripts.js';
}
}
And this is the JavaScript code:
(function ($) {
$(document).ready(function(){
$("#comment-form").validationEngine();
$('#comment-form').find('.form-type-textfield').hide();
$('#edit-comment-body').click(function() {
$('#comment-form').find('.form-type-textfield').slideDown();
});
});
})(jQuery);
I tried the code above with behavior format but it also didn't work.
How can I make this code work with Ajax Comments?