defaulting picklist value

  • 1
  • Problem
  • Updated 3 years ago
Hi,

I am trying to defaulting a value in the picklist with the JavaScript.


var params = arguments[0],
$ = skuid.$;

var result=document.getElementById("PicklistId");
result.options[1].selected = true;
result.options[1].defaultSelected = true;

But it is not working. Can any one please fix it. 

Thanks.
Photo of Arjun Kodidala

Arjun Kodidala

  • 90 Points 75 badge 2x thumb

Posted 4 years ago

  • 1
Photo of Goutham J

Goutham J

  • 568 Points 500 badge 2x thumb
Hi Arjun,

I just started using Skuid, Hope this helps.

var field = arguments[0], value = skuid.utils.decodeHTML(arguments[1]),
$ = skuid.$;
    
    var dataTypes = [];
    dataTypes.push({
        active: true
        ,defaultValue: true
        ,label : '--None--'
        ,value : ''
    });
Photo of Arjun Kodidala

Arjun Kodidala

  • 90 Points 75 badge 2x thumb
Goutham, thanks for your reply. Your code is not working.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb