I want to override a bit of core drupal behavior on the ment form.
If you make a ment as an anonymous user, your name and mail are stored in a cookie, and then javascript fills out the appropriate fields in subsequent ment forms using this code below:
Drupal.behaviorsment = function (context) {
var parts = new Array("name", "homepage", "mail");
var cookie = '';
for (i=0;i<3;i++) {
cookie = Drupalment.getCookie('ment_info_' + parts[i]);
if (cookie != '') {
$("#ment-form input[name=" + parts[i] + "]:not(ment-processed)", context)
.val(cookie)
.addClass('ment-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.
I want to override a bit of core drupal behavior on the ment form.
If you make a ment as an anonymous user, your name and mail are stored in a cookie, and then javascript fills out the appropriate fields in subsequent ment forms using this code below:
Drupal.behaviors.ment = function (context) {
var parts = new Array("name", "homepage", "mail");
var cookie = '';
for (i=0;i<3;i++) {
cookie = Drupal.ment.getCookie('ment_info_' + parts[i]);
if (cookie != '') {
$("#ment-form input[name=" + parts[i] + "]:not(.ment-processed)", context)
.val(cookie)
.addClass('ment-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.
Share Improve this question asked Oct 27, 2010 at 21:26 lazysoundsystemlazysoundsystem 2,17924 silver badges23 bronze badges1 Answer
Reset to default 6If you have a custom module, you should be able to overwrite Drupal.behaviors.ment, or delete it.
something like
drupal_add_js('delete Drupal.behaviors.ment','inline');
Of course if you already have a js file being included put it there rather than inline.