Hello,
I have a form type application in which I need to validate the information that the user enters in a field. For this I am using the onChange event, but it does not run.
This is the code that I need to execute when the user modifies the value in the field.
$check_sql = “SELECT Tipo,Longitud,Estructura,Ejemplo”
. " FROM TipoDocumentoID"
. " WHERE Tipo = ‘" . {TipoDoctoID} . "’";
sc_lookup(rs, $check_sql);
$validar = 0;
$cumple = 0;
if (isset({rs[0][0]}))
{
$tipo = {rs[0][0]};
$longitud = {rs[0][1]};
$estructura = {rs[0][2]};
$ejemplo = {rs[0][3]};
$cumple = preg_match($estructura,{DoctoID});
if ($cumple<>1){
phpAlert('El n?mero de documento de identificaci?n no cumple con la estructura. Ejemplo de ID. '.$ejemplo);
{DoctoID}='';
}
}
I tried to create another type of Ajax event, but it does not execute the code I have tried inserting the code in the onValidate event and it runs without problem, but I need to do it when the field changes.
I’m using version 9.3.005
Can someone help me?