I want to override a bit of core drupal behavior on the comment form.
If you make a comment as an anonymous user, your name and mail are stored in a cookie, and then javascript fills out the appropriate fields in subsequent comment forms using this code below:
Drupal.behaviors.comment = function (context) {
var parts = new Array("name", "homepage", "mail");
var cookie = '';
for (i=0;i<3;i++) {
cookie = Drupal.comment.getCookie('comment_info_' + parts[i]);
if (cookie != '') {
$("#comment-form input[name=" + parts[i] + "]:not(.comment-processed)", context)
.val(cookie)
.addClass('comment-processed');
}
}
};
If I don't want those fields to be filled in, I know I can just wipe out the information with further javascript, but I'm sure there's a 'cleaner' way to do it.
If you have a custom module, you should be able to overwrite Drupal.behaviors.comment, or delete it.
something like
drupal_add_js('delete Drupal.behaviors.comment','inline');
Of course if you already have a js file being included put it there rather than inline.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With