List:Eventum General Discussion« Previous MessageNext Message »
From:Diogo Salazar Date:November 25 2009 7:58pm
Subject:Bug in Mandatory Custom fields
View as plain text  
I've found this old e-mails telling how to fix the problem of mandatory
custom fields not being selected and the new issue is still submitted. Maybe
I'm not understanding how the new lines are supposed to be.

This is how my files are, after the modification:

 

eventum-2.2/templates/edit_custom_fields.tpl.html line 56

-----------------------------

{/if}

class="default" name="custom_fields[{$custom_fields[i].fld_id}]{if

       $custom_fields[i].fld_type == 'multiple'}[]{/if}"
tabindex="{$tabindex++}">

 

       {if $custom_fields[i].fld_type != 'multiple'}<option
value="">{t}Please choose an option{/t}</option>{/if}

 

       {html_options options=$custom_fields[i].field_options
selected=$smarty.request.custom_fields[$fld_id]|default:$custom_fields[i].se
lected_cfo_id|default:$custom_fields[i].default_value}

    </select>

    {/if}

--------------------------

 

 

eventum-2.2/js/validation.js line 260

--------------------------

for (var i = 0; i < custom_fields_info.length; i++) {

        var info = custom_fields_info[i];

        var field = $('#custom_field_' + info.id);

 

        if (((field.val().length < 1) || (field.val() == -1)) && 

        (field.parent().parent().css('display') == 'none')) {

            continue;

        }

 

        if (info.required == 1) {

             if (info.type == 'combo') {

                 if (getSelectedOption(f, field.attr('name')) == '-1') {

                     errors[errors.length] = new Option(info.title,
field.val());

                 }

 

            } else if (info.type == 'multiple') {

                if (!hasOneSelected(f, field.attr('name'))) {

                    errors[errors.length] = new Option(info.title,
field.val());

                }

            } else {

                if (isWhitespace(field.val())) {

                    errors[errors.length] = new Option(info.title,
field.val());

                }

            }

        }

--------------------------

 

Also, I couldn't notice what is the modification made on the
getSelectedOption function on line 350 of the eventum-2.2/js/validation.js
file.

 

Thanks,

 

 

Diogo Salazar

NeuroTech - Transformando Dados em Resultados

diogo@stripped

www.neurotech.com.br


Thread
Bug in Mandatory Custom fieldsDiogo Salazar25 Nov