Hello again,
I created some custom forms on the create account page in order to differentiate wholesale from individuals.
I create a radio button that allows select if the customer is wholesale or individuals.
The fact is that I need to hide the wholesale custom fields in the create account form if the option "individuals" is cheked.
I add an onChange method that fires a javascript function in an option button input with a class="hide" in css. It seems that all is right but doesn't work. The problem is that zencart is unable to find the function. I have tried putting it in includes/modules/pages/create_account/jscript_addr_pulldowns.php and in includes/modules/pages/create_account/jscript_form_check without success, the mozilla firebug still says that the funtion is not defined.
The function is:
Code:
function update_screen(valor) {
var conjunto = document.getElementById('datos_empresa');
alert("pp");
if (valor == 'Tienda' {
conjunto.className='hide';
} else {
conjunto.className='';
}
}
This is the radio button code:
Code:
<fieldset>
<legend><?php echo TABLE_HEADING_TIPO_DETAILS; ?></legend>
<?php
if (TIPO_CLIENTE == 'true') {
?>
<?php echo zen_draw_radio_field('tipologia_cliente', 'Tienda', '', 'onChange="return update_screen(this.value);" id="tipologia_tienda"') . '<label class="radioButtonLabel" for="tipologia_tienda">' . TIENDA . '</label>' . zen_draw_radio_field('tipologia_cliente', 'Particular', '', 'onChange="return update_screen(this.value);" id="tipologia_particular"') . '<label class="radioButtonLabel" for="tipologia_particular">' . PARTICULAR . '</label>' . (zen_not_null(ENTRY_TIPO_TEXT) ? '<span class="alert">' . ENTRY_TIPO_TEXT . '</span>': ''); ?>
<br class="clearBoth" />
Any clues of where do I have to put the function to make it work??
Thank you very much in advance!
Regards
Bookmarks