Hey guys, thank you for fixing the other bugs so fast! You are doing a great job!

Is it possible, to implement support for the term reference tree module / field? Or do I have to do it by myself?
If I have to do it, which is the best solution for this?

Comments

attiks’s picture

What do you want us to support? Reading the project page it says:

If you limit the number of selectable options, client-side javascript limits the number of terms that can be selected by disabling the other remaining options when the limit has been reached (this is enforced on the server side too).
iTiZZiMO’s picture

If I set the tree to "required", it is not recognized as required.

attiks’s picture

Assigned: Unassigned » Jelle_S
Jelle_S’s picture

Status: Active » Fixed

Added in latest dev version

iTiZZiMO’s picture

I´ve checked the new dev-version and it is validated as required, but no error-message is shown.
Are you able to reproduce this?

iTiZZiMO’s picture

I´ve found a quickfix for me, maybe you can use it for the fix.

case 3: // CLIENTSIDE_VALIDATION_AFTER_LABEL
  validate_options.errorPlacement = function(error, element) {
    if (element.is(":radio")) {
      if(parents = element.parents(".form-type-checkbox-tree")) {
        error.insertAfter(parents.find("label").first());
      } 
      else {
        error.insertAfter(element.parents('.form-radios').prev('label'));
      }
    }
    else if (element.is(":checkbox")) {
      if(parents = element.parents(".form-type-checkbox-tree")) {
        error.insertAfter(parents.find("label").first());
      } 
      else {
        error.insertAfter(element.parents('.form-checkboxes').prev('label'));
      }
    }
    else {
      error.insertAfter('label[for="'+ element.attr('id') +'"]');
    }
  }
  break;

The code takes place in clientside_validation.js after line 421

attiks’s picture

Status: Fixed » Active
Jelle_S’s picture

Status: Active » Fixed

fixed for all error placement options

Jelle_S’s picture

Assigned: Jelle_S » Unassigned

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.