How to test a variable in JavaScript

Viewed 38

I have managed to integrate the Mondial Relay widget on my site.

But I would like to be able to test if

$("[name='IDmondial']").val(data.ID)

is empty then displays in html the field is empty otherwise displays the field not empty

This is how Mondial Relay information is retrieved

function(data) {
                                        //input hidden
                                        $("[name='IDmondial']").val(data.ID);
                                        $("[name='NOMmondial']").val(data.Nom);
                                        $("[name='ADRESSEmondial']").val(data.Adresse1);
                                        $("[name='CPmondial']").val(data.CP);
                                        $("[name='VILLEmondial']").val(data.Ville);
                                        $("[name='PAYSmondial']").val(data.Pays);
    
                                    }
0 Answers
Related