AnsweredAssumed Answered

Problem to get value into javascript variable ?

Question asked by zaert on Nov 27, 2015
Latest reply on Dec 1, 2015 by zaert

Hello everyone,

 

 

Like the post title said, I want to get just the text from my list lookup drop down.

1.JPG

If I have this, I want to get in a JS variable : "Please select a value..."

 

 

I set up the list lookup like this :

2.JPG

 

I want to store the choice into JS variable with the following code :

 

NWF$("#" + Idselect_sitescodes).change(function ()

{

        var siteCodeSelectedItem = NWF$(this).find("#" + Idselect_sitescodes + " option:selected").html();

        alert("siteCodeSelectedItem : " + siteCodeSelectedItem);

});

 

How can I fix the fact that, when I want to check the value of my variable siteCodeSelectedItem, I have a message like 'Undefined' ?

3.JPG

 

Thanks

Theo

Outcomes