cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

NWF.FormFiller.Events.RegisterAfterReady(function () {var defaultTeam = NWF$("#" + ddlFavTeam).val();if (defaultTeam == '0') {NWF$("#" + ddlFavTeam).val('1');}}); not able to set the lookup dropdown value with the id of the item on form load

NWF.FormFiller.Events.RegisterAfterReady(function () {var defaultTeam = NWF$("#" + ddlFavTeam).val();if (defaultTeam == '0') {NWF$("#" + ddlFavTeam).val('1');}}); not able to set the lookup dropdown value with the id of the item on form load. tried the above code to set the lookup value but not able to set the value

Labels: (2)
Tags (1)
0 Kudos
Reply
3 Replies
Not applicable

Re: NWF.FormFiller.Events.RegisterAfterReady(function () {var defaultTeam = NWF$("#" + ddlFavTeam).val();if (defaultTeam == '0') {NWF$("#" + ddlFavTeam).val('1');}}); not able to set the lookup dropdown value with the id of the item on form load

You can use:

NWF$(document).ready(function(){

setTimeout(function(){

// your code or function here ....

},1000);

})

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: NWF.FormFiller.Events.RegisterAfterReady(function () {var defaultTeam = NWF$("#" + ddlFavTeam).val();if (defaultTeam == '0') {NWF$("#" + ddlFavTeam).val('1');}}); not able to set the lookup dropdown value with the id of the item on form load

I have tried the below code but its not working for me

NWF$(document).ready(function(){

setTimeout(function(){

var defaultTeam =
NWF$("#" +ddlTeam).val();

if (defaultTeam=='0') {

NWF$("#"
+ddlTeam).val('1');

}

},1000);

});

0 Kudos
Accept as Solution Reply
Highlighted
Not applicable

Re: NWF.FormFiller.Events.RegisterAfterReady(function () {var defaultTeam = NWF$("#" + ddlFavTeam).val();if (defaultTeam == '0') {NWF$("#" + ddlFavTeam).val('1');}}); not able to set the lookup dropdown value with the id of the item on form load

Try something from this post Custom Script on O365 , the script doing something similar. See if that help.

0 Kudos
Accept as Solution Reply