Change Default Button in code

  
I have 2 buttons. I would like to switch the Is Default property in code. I have been able to change the class to "Is_Default". Visually the button changes to look like the default button. However when i hit enter it's still the other button that is triggered.
Thank you for any tips.
You may be able to change it by some JavaScript trickery, but you can't by a setting. Iirc there's also an Idea for this.

Hi Kilian
what do you mean by "lirc there's also an idea  for this"
Thank you.
Fabian,

I mean that, if I recall correctly, there an Idea that would solve your problem. Unfortunately, that doesn't help you at all right now.