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');
}
});
Hi TomX,
The code looks ok to me, did you add it to a "load JS" code action in the "on load" event ? or did you use the "easy wizard" ?
Regards,
Max
The code looks ok to me, did you add it to a "load JS" code action in the "on load" event ? or did you use the "easy wizard" ?
Regards,
Max
I used the Form Wizard to create the form and edited it with the Wizard to insert the code in the Actions --> Load JS section.
Regards
Tom
Regards
Tom
Hi TomX,
Your code works OK here. Checked in FF & IE7, 8 & 9
I suspect that there may be a problem with the ü in Gewünschte Leistung - but I can't see where that is.
Bob
Your code works OK here. Checked in FF & IE7, 8 & 9
I suspect that there may be a problem with the ü in Gewünschte Leistung - but I can't see where that is.
Bob
Hi TomX,
Apologies, I didn't check here the last week, did you try Bob's suggestion ? I think any special characters may not work well with the javascript code.
Regards,
Max
Apologies, I didn't check here the last week, did you try Bob's suggestion ? I think any special characters may not work well with the javascript code.
Regards,
Max
This topic is locked and no more replies can be posted.