Change Label element onLoad JavaScript

edwinfg

New Member
Hello, I new in Joomla, Fabrik and JavaScript, but I have some knowledge in programming.

I'm trying to change the label element of a Fabrik form using inline JS, see image. Can somebody please help me to do that, I will appreciate so much.

The code:

var form = Fabrik.getBlock('form_5');

var tipo = form.formElements.get('crear_problema___tipo').getValue();

if ( tipo == "1")
{
form.formElement.set('crear_problema___respuesta').label.innerHTML = "Otro";
}
 

Attachments

  • ChangingLabelElement.png
    ChangingLabelElement.png
    58.1 KB · Views: 376
Last edited:
We have a generic Fabrik element model method for that ...

Code:
 form.formElements.get('crear_problema___respuesta').setLabel('Otro');

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top