XF 2.0 Select the correct prefix(_id) on menu via JavaScript on edit post page

Scandal

Well-known member
Hello all!
I have stack on the following.
Let's say we're on the edit thread page (first post). There, there is the prefix menu.

How could I make the following javascript function to work? Take into account that is passed to it an existing (validated) prefix_id.
When this function is running, it should change the selected prefix, to the relative prefix with id "prefix_id". I mean that the Prefix Menu should be moved to the correct prefix. I tried select menu .val(prefix_id) via jQuery but with no sucess.

I have detect the following on the xF2 javascript files (XF.PrefixMenu), but I don't know how me to make it functionable. Any idea? The following code is returning that there is no selectPrefix function, but on the /js/xf/prefix_menu.js exists. I have stack how to use it.

JavaScript:
function test(prefix_id)
{
   XF.PrefixMenu.selectPrefix(prefix_id);
}

I'm working on post_edit template.
 
Top Bottom