Un foro de discusión para nuestra comunidad de hispano hablante
User avatar
By milagrosmaria16
#814477
Buenas tardes,

Tengo una consulta, tengo el siguiente código, me funciona bien pero el campo txtNombreComercio no es obligatorio, por lo que cuando no ingreso data, el código se sigue ejecutando y no me permite continuar.
Code: Select all
 if ( getField( "txtNombreComercio" ).value.length < 5 && getField( "cboTipoCliente" ).value == 2 ) {
  alert("Favor ingresar 5 dígitos como mínimo en el campo Nombre Comercial", "Advertencia"); return false;
  } 
¿Hay forma de ejecutarlo solo cuándo haya texto en el campo?

Espero me puedan apoyar por favor.

Muchas gracias!!!
User avatar
By amosbatto
#814481
Puedes usar este JavaScript:
Code: Select all
if ( getField( "txtNombreComercio" ).value != "" && getField( "txtNombreComercio" ).value.length < 5 && 
      getField( "cboTipoCliente" ).value == 2 )
{
  alert("Favor ingresar 5 dígitos como mínimo en el campo Nombre Comercial", "Advertencia"); return false;
} 
Want to create your own meme coin?

In the world of cryptocurrencies, a unique and exc[…]

The market for cryptocurrencies is demonstrating a[…]

What's SAP FICO?

Embarking on a dissertation can be one of the most[…]

Hello. For rental housing, there are software solu[…]