Solved

How to set default value some option in drop down list look up using JQuery or Javascript

  • 20 July 2017
  • 2 replies
  • 358 views

Badge +4

Hi Team,

Is there any way to set some option value to list look up using Jquery or javascript.

205778_pastedImage_1.png

Note: This should not always 0 - NA. But some cases i have to set 1 - Internal Fraud.

icon

Best answer by joseph_cervi 20 July 2017, 18:28

View original

2 replies

Badge +5

This should do it for you.  This code populates the default value with the selectedindex.  Change the index to the specific option number you want.  

var JS_ControlName_X = JS_ControlName.replace('_hid',"");

NWF$('#'+JS_ControlName_X).prop('selectedIndex',0);

NWF$('#'+JS_ControlName_X).trigger("change");

Badge +2
Hi Joseph,
Can you explain this code a little bit more? Not exactly sure what is going on.

Reply