Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82461

How to check if the select did not find any rows

$
0
0

How can i check if the select did not find any rows so i can hide the field?

    pasEditor.dependent('passcons.pas_turno', function (val, data, callback) {
        if ( val ){ 
            // cerca nella tabella tris se esiste un nominativo che ha
            // tris.pas_turno = passcons.pass_turno e 
            // tris.tri_giorno = numero del giorno ricavato dalla data 
            pdata = pasEditor.val("passcons.pas_data");
            //alert(pdata+" - "+val);
            $.ajax({
                type: "POST",
                url: 'php/chk_giorno.php',
                async: true,
                data: {pdata: pdata, pturno: val}, 
                dataType: "json",
                success: function (data) {
                   if...   
                   ---> I would like to hide the field if the query found no rows <--
                   pasEditor.hide('passcons.pas_idtris');
                   else...
                   callback( data );
                },
                error: function (data) {
                    alert("Errore chk_giorno.php");
                },                      
            }); 
        }
        return {};      
    } );``

Thank for help...
Giuseppe


Viewing all articles
Browse latest Browse all 82461

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>