CA Service Management

 View Only
  • 1.  Enable or Disable Text Field when select option from drop down list

    Posted Jan 14, 2020 12:49 PM
    Hey!!

    I'm creating one form y Catalog but i need enable or disable a text field when select an option especifi from drop down list.

    So, i have this form:


    When i select Cobis in Sistema, i see other 4 options in Tipo so...if i select Firma in Tipo, the vale of this is and i create the field Turno Hidden by default and create this script:

    EnableTurno: function() {
           if (cmbAcceso==2) {
           ca_fdShowField(ca_fd.formId, 'txtTurno');
           }
        }

    I add this to js onChange attr:



    But when i select the value Firma show the numer 2 and not show the field Turno......if i put the script w/out one "=":

    EnableTurno: function() {
           if (cmbAcceso=2) {
           ca_fdShowField(ca_fd.formId, 'txtTurno');
           }
        }

    Show the field Turno but in any selection of thw drop down list


  • 2.  RE: Enable or Disable Text Field when select option from drop down list
    Best Answer

    Posted Jan 21, 2020 09:55 AM
    I solved this with this javascript:

    xxx: function() {
    var valorselect = ca_fdGetSelectedOptionValues(ca_fd.formId,'cmbSistema');

    alert(valorselect); /*To see if i got the value of cmbSistema*/

    if (valorselect == 10){
    ca_fdShowFields(ca_fd.formId,['cmbFha','cmbFirma','cmbClave']); /*To show*/
    ca_fdHideFields(ca_fd.formId,['cmbFha','cmbFirma','cmbClave']); /*To hide*/
    ca_fdEnableField(ca_fd.formId,'cmbFha'); /*To Enable*/
    a_fdDisableField(ca_fd.formId,'cmbFha'); /*To Disable*/
    }