Forums

Combo the checkbox

GreyHead 23 Mar, 2015
1 Likes
Hi zaplcgn,

What do you have in the Options box and the Extra Params box exactly?

Bob
zaplcgn 23 Mar, 2015
Options:
Hauptschule=Hauptschule
Realschule=Realschule
Gesamtschule=Gesamtschule
Other=Other


ExtraPrms

window.addEvent('domready', function() {
  var select, other;
  select = $('choose_one_container_div');
  other  = $('choose_one_other');
  switchOther();
  select.addEvent('change', switchOther);

  function switchOther() {
    var checked = $$('input[value=Other]:checked');
    if ( checked.length > 0 ) {
      other.disabled = false;
    } else {
      other.value = '';
      other.disabled = true;
    }
  }
});
zaplcgn 23 Mar, 2015
like to change the Word OTHER to the german word Andere too
GreyHead 24 Mar, 2015
1 Likes
Hi zaplcgn,

a. The Extra Parameters box is for attributes to be added to the input element e.g. readonly=readonly. It is not intended to take chunks of JavaScript - please use the Load JavaScript action for that.

b. The JavaScript you are using here is using MooTools syntax which will work OK with CFv4 on Joomla! 1.5 but may not be loaded with CFv5 and Joomla! 3 as Joomla! have switched to use the jQuery library as standard. ChronoForms v5 has a built-in event manager that you can use to show/hide elements or containers. I suggest that you use that instead of custom script.

Bob
zaplcgn 25 Mar, 2015
Hi GreyHead... thanks and now i don't know how to do this...I don't understand really php and java scripts😟
This topic is locked and no more replies can be posted.