Skip to main content
Nintex Community Menu Bar
Solved

How to get selected value from dropdown list in JavaScript

  • July 27, 2017
  • 5 replies
  • 453 views

Forum|alt.badge.img+2

I have a dropdown list Name Approver (APN) need to validate the selected Approver is equal to current user name on a button click if true need to set value in Radio button(Yes/No) to No 

 

Java script code i am using as below

 

NWF$('#'+ApID).val(); is returning 1 need to display the selected value. 

 

if(NWF$('#' + APN).val()=="Current User (Display Name)")
{

alert(NWF$('#'+ApID).val());
alert("Current User (Display Name)");
}

Best answer by prasadplvv

Thank for the follow up i got the answer. NWF$('#' + APN).find("option:selected").text();

Can you please help to Check radio button based on a value.

Tried the below code but it was used to clear the checked value in the radio button.

NWF$('#' + txtElection).find("input:checked").attr('checked',false);

5 replies

Forum|alt.badge.img+16
  • July 28, 2017

What do you get on NWF$('#' + APN).val() ?


Forum|alt.badge.img+2
  • Author
  • July 28, 2017

Yes it should me equal to the display Name . 


Forum|alt.badge.img+2
  • Author
  • July 28, 2017

In alert it is Displaying 1


Forum|alt.badge.img+4

Is it a simple dropdown list or a lookup ?


Forum|alt.badge.img+2
  • Author
  • Answer
  • July 28, 2017

Thank for the follow up i got the answer. NWF$('#' + APN).find("option:selected").text();

Can you please help to Check radio button based on a value.

Tried the below code but it was used to clear the checked value in the radio button.

NWF$('#' + txtElection).find("input:checked").attr('checked',false);