<select id="x_myfield" ...>
<option value="1">one</option>
<option value="2">two</option>
$('#x_myfield').val('1'); // Select the option with a value of '1'
$('#x_myfield').trigger('change'); // Notify any JS components that the value changed
I added this code to make custom selection from select2 on initial load but nothing is being selected.
in jsfiddle it works but through phpmaker it doesn't work
What did I miss?