Un foro de discusión para nuestra comunidad de hispano hablante
#788885
Hola quisiera saber como puedo hacer requerido un controlFile dependiendo del valor de un radio boton, he probado con este codigo pero no funciona:
Code: Select all
$("#visitaCampo").setOnchange(function() {
  if ($("#visitaCampo").getValue() == 1) {
    $("#clientsFile").show();
    enableRequiredById('clientsFile');
  }
  else {
    $("#clientsFile").hide();
  }
});
Code: Select all
$("#visitaCampo").setOnchange(function() {
  if($("#visitaCampo").getValue() == 1) {
    $("#clientsFile").show();
    $("#clientsFile").required();
  }
  else {
    $("#clientsFile").hide();
  }
});
Last edited by fardon on Sun Feb 05, 2017 5:13 pm, edited 1 time in total.
#788888
Solo puedes asignar 1 change event handler en un campo y no debes mezclar codigo de version 2 y version 3.
Ver:
http://wiki.processmaker.com/3.0/JavaSc ... Validation

Tu codigo debe ser:
Code: Select all
$("#visitaCampo").setOnchange(function( newVal, oldVal) {
  if (newVal == 1) {
    $("#clientsFile").show();
    $("#clientsFile").enableValidation();
  }
  else {
    $("#clientsFile").hide();
    $("#clientsFile").disableValidation();
  }
});
Estoy asumiendo en las opciones de este radio, tienes algo como:
Code: Select all
key | label
------------
1   | Visita
2   | No visita 

In the rapidly evolving world of online sports be[…]

STEPN integrates social networking and games that […]

Cenforce 150 is a medication used to cope with a c[…]

What's SAP FICO?

Trustworthy and skill-building, each of these actu[…]