Hi,
I have a simple form with a select box. I want to show / hide a textfield or something else depending on the selection.
I added a script but it does not work!?
CF v4 / Joomla 1.5 / MooTools Upgrade 1.2
The script:
I have a simple form with a select box. I want to show / hide a textfield or something else depending on the selection.
I added a script but it does not work!?
CF v4 / Joomla 1.5 / MooTools Upgrade 1.2
The script:
window.addEvent('domready', function() {
$('input_select_betreff').addEvent('change', function() {
if ($('input_select_betreff').value == 'hochzeitsfotografie' ) {
$('gew_nschte_leistung_container_div').setStyle('display', 'block');
} else {
$('gew_nschte_leistung_container_div').setStyle('display', 'none');
}
});
// initialise the display
if ($('input_select_betreff').value == 'hochzeitsfotografie' ) {
$('gew_nschte_leistung_container_div').setStyle('display', 'block');
} else {
$('gew_nschte_leistung_container_div').setStyle('display', 'none');
}
});