[SOLVED] Object #<HTMLDivElement> has no method 'dissolve'

GreyHead 07 May, 2013
Hi capitanluc,

Probably this doesn't exist in the MooTools version you are using (Joomla 1.5 uses MooTools 1.2 and current versions use MooTools 1.4). You can probably edit the code to use .setStyle('display', 'block') and .setStyle('display', 'none') to show and hide the elements.

Bob
capitanluc 07 May, 2013
Thanks a lot. What I did before to read your kind answer was to modify the script as follows:
var checkbox_id, textarea_id, checkbox, textarea, div;
/* edit the next two lines to match the ids of the elements in your form */
checkbox_id = "k2013paymentmethod";
textarea_id = "k2013mtcn";

window.addEvent('domready', function() {
  checkbox = $(checkbox_id);
  textarea = $(textarea_id);
  div = $(textarea_id+"_container_div");
//  div.dissolve();
  showHide();
  checkbox.addEvent('click', showHide);
});

function showHide() {
  if ( checkbox.checked ) {
//    div.reveal();
    textarea.disabled = false;
    textarea.required= true;
  } else {
//    div.dissolve();
    textarea.value = '';
    textarea.disabled = true;
    textarea.required= false;
  }
}

It was just a small and dirty workaround but the results is exactly what I really wanted. In fact the textarea does not disappear but is disabled or enabled according to the checkbox status. At the same time the script modifies the required attribute.
Thanks again.
Luciano
This topic is locked and no more replies can be posted.