How to assign custom values to select field in js

Hi,
I want to change select field content with another one in any action
here is my code

type_of_contract : function () { if (cur_frm.doc.type_of_contract == "test") { cur_frm.set_value("reason","\ntest1\ntest2"); } },

in my code I want to set tesy1 & test2 in the select field when the action happen
thanks all

@OmarJaber try:

cur_frm.set_df_property("reason", "options", "\ntest1\ntest2");
4 Likes

Thanks its work :smiley: