Event Switcher: Error Message Near Field

Bu BuDuS 07 Apr, 2015
Hi

There is a way to display error message from Event Switcher near the field and not at the top ?

Thanks, Andrea.
Gr GreyHead 09 Apr, 2015
Hi Andrea,

The Event Switcher doesn't usually display a message unless you have added one to an action. I'm guessing that you have a message displaying in the Joomla! System Message location at the top of the page.

You can set a form variable in a hidden element (or set a JavaScript variable) and add a message to a form Custom Code element, then use JavaScript to scroll the page to that location and display the message if the form variable is set.

Bob
Bu BuDuS 09 Apr, 2015
mmm :?

In the old version (v3) I have this code:


if ($RADIO_CONSENSO_TRATTAMENTO_DATI_PERSONALI == "NO") {
        $form->validation_errors['RADIO_CONSENSO_TRATTAMENTO_DATI_PERSONALI'] = "Senza il consenso al trattamento dei dati personali non è possibile procedere (hai scelto: $RADIO_CONSENSO_TRATTAMENTO_DATI_PERSONALI).";
        
        return false;
    }


in the Custom Server Side Validation.

In the Event Switcher I have a code like this:


if ($RADIO_CONSENSO_TRATTAMENTO_DATI_PERSONALI == "NO") {
        $form->errors['RADIO_CONSENSO_TRATTAMENTO_DATI_PERSONALI'] = "Senza il consenso al trattamento dei dati personali non è possibile procedere (hai scelto: $RADIO_CONSENSO_TRATTAMENTO_DATI_PERSONALI).";
        
        return "fail";
    }


when the difference is container, method ("errors" rather than "validation_errors") and return value ("fail" rather than false).

But in the v3 the message is displayed correctly, near the field.
Is not possible in v5 ? 😲
This topic is locked and no more replies can be posted.